Is the above MATLAB code syntax for temporarily pausing the simulation using if else statement, correct or wrong, if wrong then suggest the correct syntax ?
1 回表示 (過去 30 日間)
古いコメントを表示
for i = 1:1:99
if (t == (0.05 * i))
pause(0.00001);
else
continue;
end
end
1 件のコメント
Dyuman Joshi
2022 年 6 月 15 日
編集済み: Dyuman Joshi
2022 年 6 月 15 日
The syntax looks correct. Though, else part is redundant.
回答 (1 件)
Sandeep
2023 年 8 月 30 日
Hi Siddharth Kamila,
As far as syntax is concerned your code looks good but the continue statement is not necessary in this case.
To pause the simulation at specific time intervals, you can use the pause function with a specified time delay. Here's the corrected code:
for i = 1:1:99
if (t == 0.05 * i)
pause(0.00001);
end
end
Hope you find it helpful.
0 件のコメント
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!