How to plot two vectors of different lengths in MATLAB?

조회 수: 1 (최근 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 CenterFile Exchange에서 Scatter Plots에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by