필터 지우기
필터 지우기

plotting vectors with differnt length

조회 수: 1 (최근 30일)
U Chon Cheang
U Chon Cheang 2022년 10월 22일
편집: Matt J 2022년 10월 22일
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일
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개)

카테고리

Help CenterFile Exchange에서 Line Plots에 대해 자세히 알아보기

제품


릴리스

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by