n=input('n: '); %n=80
uy=0.2;
while n<120
n=n+10;
uy=uy+0.1;
if uy>=0.4&uy<=0.6
n
uy
continue
end
end
result
n=100&uy=0.4
n=110&uy=0.5
n=120&uy=0.6
I want the result converted into a matrix I'm making a gui I want it automatically thanks for helping me

 採用された回答

Stephen23
Stephen23 2018 年 9 月 2 日

1 投票

For various reasons, using a loop is not a good approach. Using colon or linspace will be numeric more stable, and more efficient:
>> n = 100:10:120
n =
100 110 120
>> uy = 0.4:0.1:0.6
uy =
0.40000 0.50000 0.60000

1 件のコメント

Le Huu Dan
Le Huu Dan 2018 年 9 月 2 日
Thanks. I'm making a gui I want it automatically

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File Exchange で MATLAB についてさらに検索

タグ

質問済み:

2018 年 9 月 2 日

編集済み:

2018 年 9 月 2 日

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by