How to plot two vectors of different lengths in MATLAB?

2 ビュー (過去 30 日間)
Kyrillos Youssef
Kyrillos Youssef 2021 年 2 月 10 日
コメント済み: Kyrillos Youssef 2021 年 2 月 10 日
Hello everyone,
I have a vector Y where its length is smaller than the length of a vector X.
I want to take just the first elements from vector X which is correponding the elements of vector Y to plot them (X and Y) together. In other words, I want to delete the elements on vector X which makes the length of X exceeds the length of Y.
Thanks in advance dears!

採用された回答

Walter Roberson
Walter Roberson 2021 年 2 月 10 日
plot(X(1:length(Y)), Y)

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeScatter Plots についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by