plotting vectors with differnt length

Hi guys, I just wonder if it is possible to plot with vectors that have different length.
For exmaple,
t = [1 2 3 4 ]
x = [1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16]
so if I do plot(t,x) it should tells me that the length are not the same. Since the size of x is 4 times of t, so is it possible to do plot(t,x) but maybe scale 4 times bigger or sth?
Thank you.

 採用された回答

Matt J
Matt J 2022 年 10 月 22 日
編集済み: Matt J 2022 年 10 月 22 日

0 投票

Below is one possibility, but you've left us much room for speculation on how the plot should look.
t = [1 2 3 4 ];
x = [1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16];
tt=linspace(min(t),max(t),numel(x));
plot(tt,x)

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeCreating and Concatenating Matrices についてさらに検索

製品

リリース

R2022a

質問済み:

2022 年 10 月 22 日

編集済み:

2022 年 10 月 22 日

Community Treasure Hunt

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

Start Hunting!

Translated by