채택된 답변

Ameer Hamza
Ameer Hamza 2020년 5월 10일
편집: Ameer Hamza 2020년 5월 10일

1 개 추천

You need to use an array to store all the values. If values are scalar or vectors of constant length, then you can use simple arrays. If, in each iteration, the result is of variable length, then you will need to use cell arrays. For example
A = zeros(1, 10)
for i = 2:10
A(i) = A(i-1) + 1;
end

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기

질문:

2020년 5월 10일

편집:

2020년 5월 10일

Community Treasure Hunt

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

Start Hunting!

Translated by