Plot each individual cells in different graphs

조회 수: 2 (최근 30일)
Jonathan Cheong
Jonathan Cheong 2021년 3월 15일
댓글: Jonathan Cheong 2021년 3월 15일
Hello, I have a two cell arrays I would like to plot as individual graphs. And be able to show them whenever I need to.
X-axis = 'datecell.mat'
Y-axis = 'smcell.mat'
The code I have averages everything onto one graph. But I'd like to split them up.
figure(2)
for ci = 1:length(finalindex)
ddplots{ci} = plot(datecell{ci},smcell{ci});
ylim = ([smcell{ci}]);
end
legend
Many thanks.

채택된 답변

KALYAN ACHARJYA
KALYAN ACHARJYA 2021년 3월 15일
편집: KALYAN ACHARJYA 2021년 3월 15일
datecell=load('datecell.mat');
datecell=datecell.datecell;
smcell=load('smcell.mat');
smcell=smcell.smcell;
figure,
for ci= 1:length(datecell)
plot(datecell{ci},smcell{ci});
hold on;
end
grid on;
Or
datecell=load('datecell.mat');
datecell=datecell.datecell;
smcell=load('smcell.mat');
smcell=smcell.smcell;
for ci= 1:length(datecell)
figure,plot(datecell{ci},smcell{ci});
end
grid on;
Note: Few cases, there are empty cell elments
  댓글 수: 1
Jonathan Cheong
Jonathan Cheong 2021년 3월 15일
Thanks for the help. Yea, I'll be removing the empty cells.

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 2-D and 3-D Plots에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by