For Loop Help with Output

조회 수: 1 (최근 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 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