Hello,
I'd like to ask you for help.
I'm currently preparing simple application for an instrument which I use in the lab.
Basicaly you input values in through some form and the instrument sets (changes) voltage to the value you input and keeps it for the time you input.
I tried to use for loop in this case, at first you create an matrix of inputs for example Ut = (3×2) matrix.
Now I created a for loop which I expected to execute operations in function zobraz after some time in this case three times. for cnt = 1:ValCnt t = timer; t.StartDelay = Ut(cnt,2); t.TimerFcn = {@zobraz, Ut}; start(t); end
Basicaly if Ut = (1 10; 5 18; 3 14), I'd like to run the application with value 1 for ten seconds then change the value from 1 to 5 and run the application for 18 seconds and then change the value from 5 to 3 and run the application for 14 seconds. But when I use the code above it executes first operation after some random time, second operation goes off immediately after the first one and the third one is executed after some time, but basicaly times are not similar to my input.
I hope its understandable and that you can help me with this problem, I'm getting pretty frustated over this thing and I would really appreciate your help.
Thank you very much.
Best Answer