doing some orders in specific time in a loop
1 次查看(过去 30 天)
显示 更早的评论
Hi
I'm using this code to do some orders in a for loop, I want to measure the time in the loop and if the passed time equals to a specific value do another order else wait until that specific time but the code do the for loop as soon as posible and never checked that time.could you help me please,
this is the code:
clear,clc
a = 5;
b = ones(2);
x = zeros(2);
t3 = zeros(1,5);
for i = 1:5
tic
c = a*b;
k = x-2*c;
x = k;
while toc == 0.5
k = k*3;
end
end
0 个评论
采纳的回答
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Loops and Conditional Statements 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!