I want to plot these 8 time series using for loop but it plots just the last one alone.
for i=1:8
plot(x,y{i},'LineWidth',2);
hold on
end
hold off

 채택된 답변

madhan ravi
madhan ravi 2019년 2월 17일
편집: madhan ravi 2019년 2월 17일

0 개 추천

If you look the data in each cell closely infact they are all the same so all the plots overlap each other:
plot(x,[y{:}]) % you don't need a loop

댓글 수: 1

To check if each cell are same:
isequal(y{:}) % if returns one then they are all the same [resulting with just one plot]

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 2-D and 3-D Plots에 대해 자세히 알아보기

질문:

2019년 2월 17일

편집:

2019년 2월 17일

Community Treasure Hunt

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

Start Hunting!

Translated by