Path: news.mathworks.com!not-for-mail
From: "Cory " <jefferscw@gmail.com>
Newsgroups: comp.soft-sys.matlab
Subject: freqs function
Date: Tue, 22 Mar 2011 23:28:04 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 65
Message-ID: <imbba4$29k$1@fred.mathworks.com>
Reply-To: "Cory " <jefferscw@gmail.com>
NNTP-Posting-Host: www-02-blr.mathworks.com
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1300836484 2356 172.30.248.47 (22 Mar 2011 23:28:04 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Tue, 22 Mar 2011 23:28:04 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 2554128
Xref: news.mathworks.com comp.soft-sys.matlab:717524

Hello,
I am keep getting the following error message:

??? Undefined function or method 'freqs' for input arguments of type 'double'.

Error in ==> main at 82
mag=abs(freqs(num_poly,den_poly,w));

The freqs function worked fine at school, but it will not work at home.  I am using the Student Version R2010a.  Is this function not supported in the Student Version?
I have also included a portion of the script file that I am trying to run.  Thanks for your help.

Cory

%%Task 3:
    disp('Task 3')
%Frequency Response:
    disp('Frequency Response:')
        s=w1*1i;
        a=polyval(num_poly,s);
        b=polyval(den_poly,s);
        FR=a/b
w=logspace(d1,d2,n);
resp=polyval(num_poly,w*1i)./polyval(den_poly,w*1i);
real_resp=real(resp);
imaginary_resp=imag(resp);
f=[w(1:3)' real(resp(1:3))' imag(resp(1:3))'];
f=[f; w(floor(n/2):floor(n/2)+2)' real(resp(floor(n/2):floor(n/2)+2))' imag(resp(floor(n/2):floor(n/2)+2))'];
f=[f; w(end-2:end)' real(resp(end-2:end))' imag(resp(end-2:end))'];
disp('      Frequency     Real              Imaginary')
%fix the 5 sig figures and the alignment
fprintf('%15.4f     %6.4e       %6.4e\n',f')
disp(' ')
%%Task 4
    disp('Task 4')
%Plot of Frequenct Response
    disp('Plot of Frequenct Response')
    disp('PRESS ANY KEY TO SEE FIGURE 1')
pause
plot (real_resp,imaginary_resp,'k')
xlabel('Real part')
ylabel('Imaginary part')
title('Frequency response of the system')
disp('PRESS ANY KEY TO CONTINUE')
pause
disp(' ')
%%Task 5
    disp('Task 5')
%Bode Diagram
    disp('Bode Diagram')
    disp('PRESS ANY KEY TO SEE FIGURE 2')
pause
mag=abs(freqs(num_poly,den_poly,w));  *************HERE*****************
%phase angle
phang=(phase(resp));
phadeg=phang*180/pi;
%Bode Plots
subplot(2,1,1)
semilogx(w,20*log10(mag))
ylabel('Log-Magnitude')
title('Bode diagram')
subplot(2,1,2)
semilogx(w,phaseang*(180/pi))
ylabel('Phase')
xlabel('Frequency')
disp(' ')