vectors must be at the same length error

1 回表示 (過去 30 日間)
fatemeh p
fatemeh p 2019 年 10 月 20 日
コメント済み: fatemeh p 2019 年 10 月 20 日
Hi, im trying to plot this fuction but im getting th 'vectors must be at the same length' error, Can anybody help to find a solution?
t=-10:10;
x = heaviside(t+2)-heaviside(t-2);
plot(t,x);
y = awgn(x,21,'measured');
plot(t,[x y]);
legend('Original Signal','Signal with AWGN');

採用された回答

Daniel M
Daniel M 2019 年 10 月 20 日
You are concatenating x and y into a doubly long vector. If you want to plot both signals, do
plot(t,x,t,y)
  1 件のコメント
fatemeh p
fatemeh p 2019 年 10 月 20 日
Thanks

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeVibration Analysis についてさらに検索

タグ

製品

Community Treasure Hunt

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

Start Hunting!

Translated by