Info
이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.
hi sir, how to save max(value) for each iteration in nested for loop?i attach one sample code here,please look after it sir.
조회 수: 1 (최근 30일)
이전 댓글 표시
t=[1 2 3 4 5];
for i=1:4
for j=1:5
k=i+j;
l=max(k)% i need to store max(k)value from each iteration
end
end
[in 1st iteration i=1 and =1:5,so k=2,3,4,5,6,therefore l=6(save it in array),in next iteration i=2 j=1:5,so k=3,4,5,6,7,therefore l=7 (save 7 in same array)
답변 (0개)
이 질문은 마감되었습니다.
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!