why is matlab giving me undefined variable cheby1?

clear all;
w1 = 2*pi*2000;
w2 = 2*pi*4000;
wn = [w1 w2];
Rp = 3;
[b,a]= chebyl(6,Rp,wn,'s');
[z,p,k] = cheby1(6,Rp,wn,'s');
subplot(2,1,1);
zplane(z,p);
H = zpk(z,p,k);
[h,w] = freqs(b,a,2000);
subplot(2,1,2);
n=20*log10(abs(h));
plot(w/(2*pi),n);
xlabel('Hz');
ylabel('Gain in db');
xlim([0 8000]);
title(' Chebyshev Type 1 Band Pass Filter');
COMMAND WINDOW ERROR
Undefined function or variable 'chebyl'.
Error in chebychev_band_test (line 11)
[b,a]= chebyl(6,Rp,wn,'s');

1 Comment

I checked if i have cheby1 installed in my computer
>> which cheby1
D:\studies\matlab\MATLAB Production Server\R2015a\toolbox\signal\signal\cheby1.m

Sign in to comment.

Answers (1)

Your code calls the function chebyl not cheby1 . Lower-case L where you need digit 1

Asked:

on 2 Sep 2017

Answered:

on 2 Sep 2017

Community Treasure Hunt

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

Start Hunting!