erreor in matlab in the function freqz

4 views (last 30 days)
boutaina doudouche
boutaina doudouche on 23 Dec 2020
Commented: Star Strider on 23 Dec 2020
Hello everyone,
i have an error in MATLAB that i can't have a solution,please help me if you can
this is the code MATLAB:
Nt=7;
N=(Nt-1)/2;
n=-N:1:N;
h=(1/3)*sinc(n/3);
[H,F] = freqz(h ,1 , 1024);
subplot(3,1,2),plot(abs(H)),title(' le gain');
subplot(3,1,3),plot(angle(H)),title('la phase');
and this is the error :

Answers (1)

Star Strider
Star Strider on 23 Dec 2020
The code works correctly when I run it, and indicates that it creates a lowpass filter with a passband of about .
You actually did not post what the error message was, only that it appeared. What is the full error message (all the red text)?
  2 Comments
boutaina doudouche
boutaina doudouche on 23 Dec 2020
the error message is in this line :[H,w] = freqz(h,1,1024)
i don't know what to do and i tommorow i must send this TP to my professor
Star Strider
Star Strider on 23 Dec 2020
There must be more to the error message than that.
In its absence, do you have your own funciton or variable named freqz?
To see if you do, run this from the Command Window or a script:
which freqz -all
The only result should be:
C:\Program Files\MATLAB\R2020b\toolbox\signal\signal\freqz.m
(or something simillar for your release).
If you get anything else, that is the problem and the solution is to re-name your function or variable.

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!