フィルターのクリア

Convolute ramp signal and step signal

2 ビュー (過去 30 日間)
RandomChikiBum
RandomChikiBum 2021 年 12 月 27 日
コメント済み: Aditya Goel 2021 年 12 月 30 日
I am supposed to convolute a unit ramp signal and a step signal (till t =10 secs) and I am getting an error while running my code
x = 1:1:10 ;
p = 0.1:0.1:1 ;
u = ones(1 , 10);
r = p.*u;
y = conv(r,u);
plot(x,y);
Error using plot
Vectors must be the same length.
But all the arrays are of the same length i,e 10

採用された回答

VBBV
VBBV 2021 年 12 月 27 日
x = 1:1:10 ;
p = linspace(0.1,1,length(x));
u = ones(1 , length(x));
r = p.*u;
y = conv(r,u,'same');
plot(x,y);
Try using additional arguments for conv function
  2 件のコメント
RandomChikiBum
RandomChikiBum 2021 年 12 月 27 日
Thanks for the answer VBBV! can you explain what 'same' means here? Matlab help isn't elaborate enough
Aditya Goel
Aditya Goel 2021 年 12 月 30 日
w = conv(u,v,shape) returns a subsection of the convolution, as specified by shape. For example, conv(u,v,'same') returns only the central part of the convolution, the same size as u.

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

その他の回答 (0 件)

カテゴリ

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

製品


リリース

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by