Plotting data based on index

조회 수: 18 (최근 30일)
Saar Peles
Saar Peles 2020년 4월 29일
답변: Star Strider 2020년 4월 29일
I'm trying to plot multiple data sets of arrays that have the same size (1 col 27 rows) on the same plot. The x axis should be the row or index of the datum and the y axis would be its value. How do I do this? I don't normally use plots so this may be a dumb question. Thanks in advance

채택된 답변

Star Strider
Star Strider 2020년 4월 29일
I would do something like this:
y = (sin([1;2;3]*(0:26)*pi/13)).'; % Create Matrix
x = 1:size(y,1);
figure
plot(x, y)
grid

추가 답변 (0개)

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by