Create a simple while-loop.
5 ビュー (過去 30 日間)
古いコメントを表示
Hi! I would like to create a simple while-loop for this problem:
input t = 'Pick a number'
i = 1:300
K = 1.5^t - 1*i
while K>0 continue,
while K<0 stop and disp 'i'.
end
How do I do this script in MatLab? Thanks!
0 件のコメント
回答 (1 件)
Andrew Newell
2014 年 4 月 24 日
If your goal is to find the next integer above 1.5^t, you could do it using
ceil(1.5^t)
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!