I wrote this script
clc
clear
for ro=0.01:0.01:0.5
clear('alpha')
for alpha=0.25:0.25:4
clear('beta')
for beta=0.25:0.25:4
disp([ro', alpha',beta'])
end
when I run it and the result shows up it doesn't start with initial values which is (0.25,0.25) and take diffrent one each time i run the script thanks

 採用された回答

madhan ravi
madhan ravi 2018 年 10 月 24 日

0 投票

ro=0.01:0.01:0.5
alpha=0.25:0.25:4
beta=0.25:0.25:4
for i = 1:numel(ro)
for l = 1:numel(alpha)
for k = 1:numel(beta)
disp([ro(i)', alpha(l)',beta(k)'])
end
end
end

5 件のコメント

Ammar kreem
Ammar kreem 2018 年 10 月 24 日
dear Madhan i tried your answer but the values dosnt start with 0.01 0.25 0.25 which i need to
madhan ravi
madhan ravi 2018 年 10 月 24 日
give an example of your output just few rows so the pattern what you require is understood
Ammar kreem
Ammar kreem 2018 年 10 月 24 日
dear Madhan this what I got 1.9100 1.0000 3.5000
1.9100 1.0000 3.7500
1.9100 1.0000 4.0000
and this what i need
0.01 0.25 0.25
0.01 0.25 0.5
and end with 2 4 4
thanks for everything
madhan ravi
madhan ravi 2018 年 10 月 25 日
You want to display the numbers like the below? 0.01 0.25 0.25
0.01 0.25 0.5
2 4 4
madhan ravi
madhan ravi 2018 年 10 月 25 日
disp([ro(i), alpha(l),beta(k)])

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

その他の回答 (1 件)

Ammar kreem
Ammar kreem 2018 年 10 月 25 日

0 投票

this how i want the result

カテゴリ

ヘルプ センター および File ExchangeLoops and Conditional Statements についてさらに検索

製品

リリース

R2018a

タグ

質問済み:

2018 年 10 月 24 日

回答済み:

2018 年 10 月 25 日

Community Treasure Hunt

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

Start Hunting!

Translated by