Can any one help me to correct this code

7 Ansichten (letzte 30 Tage)
Kuheli Mondal
Kuheli Mondal am 20 Mär. 2016
Kommentiert: Image Analyst am 20 Mär. 2016
function h=dd1(n)
h=zeros(1, length(n));
n = [1 2 3 4 5 6 7];
h(n==0) = 1;
n=-10:10;
h(n)=dd1(n-3)-2.7083*dd1(n-4)+4.1861*dd1(n-5)-3.0451*dd1(n-6)+0.73071*dd1(n-7);
stem(n, h)
xlabel('n')
ylabel('Delta Function')
Thank you.

Akzeptierte Antwort

Azzi Abdelmalek
Azzi Abdelmalek am 20 Mär. 2016
function h=dd1(n)
h=zeros(1, length(n));
% n = [1 2 3 4 5 6 7]; % What this line is doing here?
h(n==0) = 1;
The call your function
n=-10:10;
h=dd1(n-3)-2.7083*dd1(n-4)+4.1861*dd1(n-5)-3.0451*dd1(n-6)+0.73071*dd1(n-7);
stem(n, h)
xlabel('n')
ylabel('Delta Function')
  2 Kommentare
Kuheli Mondal
Kuheli Mondal am 20 Mär. 2016
??? Input argument "n" is undefined.
Error in ==> dd1 at 4 h=zeros(1, length(n)); how to solve this error
Image Analyst
Image Analyst am 20 Mär. 2016
The question is now marked as Accepted so I presume you corrected it by now.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Linear Algebra finden Sie in Help Center und File Exchange

Tags

Noch keine Tags eingegeben.

Community Treasure Hunt

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

Start Hunting!

Translated by