Error using plot Vectors must be the same length in convolution

Error in "Vector must be the same length" at plot
I don't know what wrong, can someone point out the mistake i make.
%Calculate the convolution of signals:
t= -5:0.01:5;
x1= @(t) (2*us(1-t)+us(t+2))+...
-2*(us(t-1)+us(4-t)));
x2=@(t) (3*(us(t+2)-us(t-2)));
%%%
h= @(t) (3.*exp((1/3).*t).*us(t-3));
%%%
y1= conv(x1(t),h(t));
y2= conv(x2(t),h(t));
plot(t,y1,t,y2);

2 件のコメント

madhan ravi
madhan ravi 2018 年 12 月 17 日
us?
Nam Nguyen
Nam Nguyen 2018 年 12 月 17 日
Oh yeah, that is unit step function.

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

 採用された回答

madhan ravi
madhan ravi 2018 年 12 月 17 日

1 投票

size(t) , size(y1) and size(y2) have to be the same

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeLine Plots についてさらに検索

質問済み:

2018 年 12 月 17 日

コメント済み:

2018 年 12 月 17 日

Community Treasure Hunt

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

Start Hunting!

Translated by