Info
이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.
How to have several plots with decreasing data in x direction for each plots
조회 수: 1 (최근 30일)
이전 댓글 표시
Hi Guys,
I have 4 plots to make them fit in one graph, basically those plots are from a bench of output data. Those data, in y or x have the same physical properties as in x(timeSteps) and y(flamePosition). As an exemple, plot1 has: X1=(1,2,3,4,5,6,7,8,9,10) y1=(2,4,6,8,3,7,4,1,9,4), plot2(the number of time steps is less) X2=(1,2,3,4,5,6) y2=(1,1,7,8,3,7), plot3 X3=(1,2,3,4) y3=(2,2,7,5), plot4 X4=(1,2,3) y4=(4,5,9),
How i could have them all in one plot by considring the same x direction (the same number of data points), or is there a another way to approach the problem?,
Thanks
댓글 수: 0
답변 (1개)
Ankit Bhardwaj
2017년 4월 24일
Assuming you have the following data.
>> X1=[1,2,3,4,5,6,7,8,9,10];
>> Y1=2*X1;
>> X2 = [1,2,3,4,5,6,7,8,9];
>> Y2 = 3*X2;
In general, you can use 'hold on' to plot multiple lines on a single axis. For instance, the following command will draw two lines with different number of data points on the same axis.
>> plot(X1,Y1)
>> hold on
>> plot(X2,Y2)
Alternately, in this particular case you can just use the following command as well.
>>plot(X1,Y1,X2,Y2)
댓글 수: 0
이 질문은 마감되었습니다.
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!