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 ExchangeCreating, Deleting, and Querying Graphics Objects についてさらに検索

質問済み:

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