how to plot two variables having different length y1 it's size (1x1500) and y2 (1x1200) at the same figure according to steps in time (X-axis)

 채택된 답변

% two random vectors of different lengths
y1 = cumsum(randn(1,1500));
y2 = cumsum(randn(1,2000));
% plot them
plot(y1)
hold on
plot(y2)
xlabel('Step #')
ylabel('Position')

추가 답변 (0개)

카테고리

도움말 센터 및 File Exchange에서 Printing and Saving에 대해 자세히 알아보기

질문:

2023년 7월 1일

답변:

2023년 7월 1일

Community Treasure Hunt

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

Start Hunting!

Translated by