Unable to hold subplot inside for loop

조회 수: 18 (최근 30일)
Muhammad Sarim Mehdi
Muhammad Sarim Mehdi 2019년 2월 6일
편집: Matt J 2019년 2월 6일
hold on
subplot(3,4,12)
for zz=1:I
fg=dual_history{zz}; plot(fg(1,:))
end
I have a cell array. Each matrix inside the cell has size 48 by 1001. I want to plot every matrix in thecell array in a subplot. I use the above code but only one matrix (actually, I think only one row of that matrix) is plotted. If I use the code without subplot, it works perfectly fine but then I get a normal plot and not a subplot. Is there any solution to this? Please let me know. Thank you very much!

채택된 답변

Matt J
Matt J 2019년 2월 6일
편집: Matt J 2019년 2월 6일
subplot(3,4,12)
hold on
for zz=1:I
fg=dual_history{zz}; plot(fg(1,:))
end
hold off

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Subplots에 대해 자세히 알아보기

제품


릴리스

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by