For Loop Help with Output

17 ビュー (過去 30 日間)
Justin Manterrnacch
Justin Manterrnacch 2022 年 1 月 25 日
回答済み: David Hill 2022 年 1 月 25 日
Unsure how to make Y, over range x, output in matrix not a singular answer.
h=.1;
y=1;
for x=0:h:10
Y=y+h.*x;
end

回答 (1 件)

David Hill
David Hill 2022 年 1 月 25 日
No for-loop needed.
h=.1;
y=1;
x=0:h:10;
Y=y+h*x;

カテゴリ

Help Center および File ExchangeLoops and Conditional Statements についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by