For Loop Help with Output
显示 更早的评论
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
2022-1-25
No for-loop needed.
h=.1;
y=1;
x=0:h:10;
Y=y+h*x;
类别
在 帮助中心 和 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!