For Loop Help with Output

13 次查看(过去 30 天)
Justin Manterrnacch
回答: 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 CenterFile Exchange 中查找有关 Loops and Conditional Statements 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by