could you help me to write this formula in matlap ,and to get it's code ??

9 ビュー (過去 30 日間)
Sereena
Sereena 2014 年 3 月 30 日
編集済み: Walter Roberson 2023 年 8 月 13 日
The formula is in the picture.

採用された回答

ragesh r menon
ragesh r menon 2014 年 3 月 30 日
編集済み: ragesh r menon 2014 年 3 月 30 日
clc
close all
clear all
x=1:10;%give your x here
h=0:2:6; %give your h here
m=length(x);
n=length(h);
X=[x,zeros(1,n)];
H=[h,zeros(1,m)];
%convolution
for i=1:n+m-1
Y(i)=0;
for j=1:m
if(i-j+1>0)
Y(i)=Y(i)+X(j)*H(i-j+1);
else
display('error');
end
end
end
stem(Y);
ylabel('Y[n]');
xlabel('n');
  2 件のコメント
Sereena
Sereena 2014 年 3 月 30 日
thank you , but canu teel me how can i get the code ??
ragesh r menon
ragesh r menon 2014 年 3 月 30 日
You can copy the code to your m file and substitute x and h with your requirements. give x and h as matrices.

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

その他の回答 (1 件)

Roger Stafford
Roger Stafford 2014 年 3 月 30 日
編集済み: Walter Roberson 2023 年 8 月 13 日
That's convolution. Look up the documentation for the matlab function 'conv'.
  1 件のコメント
Sereena
Sereena 2014 年 3 月 30 日
thank you , that is helpful but how can i write it at matlap?

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

カテゴリ

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

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by