필터 지우기
필터 지우기

how to plot each row of the matrix

조회 수: 58 (최근 30일)
MAHMOUD ALZIOUD
MAHMOUD ALZIOUD 2018년 8월 2일
댓글: Star Strider 2018년 8월 2일
Dear All, I have a matrix called Single, it is composed of 365 rows and 39 columns, I need to plot each row in the same graph, meaning I need the same graph to have 365 plots. how can I please do that? my code is the following and it is not working:
for K = 1:length(Single)
plot(Single{K});
xlabel('Load in Kips');
ylabel('Percentage');
hold on
end
title('Single')

채택된 답변

Star Strider
Star Strider 2018년 8월 2일
편집: Star Strider 2018년 8월 2일
Try this:
Single = sin((1:365)'*(1:39)*2*pi/3650); % Create Data
figure(1)
plot(Single') % Without Independent Variable
grid
xlabel('Load in Kips')
ylabel('Percentage')
xv = linspace(0, 1, size(Single,2));
figure(2)
plot(xv, Single) % With Independent Variable
grid
xlabel('Load in Kips')
ylabel('Percentage')
EDIT Added axis labels.
  댓글 수: 2
MAHMOUD ALZIOUD
MAHMOUD ALZIOUD 2018년 8월 2일
thank you very much it worked
Star Strider
Star Strider 2018년 8월 2일
As always, my pleasure.

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Graphics Object Properties에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by