Extract row each iteration
이전 댓글 표시
I would like to extract a 1-row vector "K" that changes each iteration and create a matrix "C" with rows equal to the vector. I have a while loop that determines the values of "K" and just want to rerun the program 1000 times and save all "K" in the Matrix "C" as rows. This is what I am doing but looks like something is not as it is supposed be:
for ii=1:1000
while ....
K=...
end
C(ii,:)=K
end
댓글 수: 5
Miroslav Mitev
2018년 2월 22일
Stephen23
2018년 2월 22일
@Miroslav Mitev: please make a new comment and upload your code by clicking the paperclip button.
Raphael Klapczynski
2018년 2월 22일
편집: Raphael Klapczynski
2018년 2월 22일
It looks like a problem caused by K vector. The for loop works without any problems for me. Or you manipulate ii inside the while-loop.
for ii=1:4
K = rand([1 3]);
C(ii,:)=K
end
Miroslav Mitev
2018년 2월 22일
답변 (0개)
카테고리
도움말 센터 및 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!