|
||||||
| General Programming Non language specific, Assembly, Linux/Unix, Mac and anything not covered in other topics. Talk about Programming Theory here. |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
|
|||
|
i've wrote this m-file but it has some errors.
Code:
function dpzplot(b,a)
% dpzplot(b,a)
% Plots the pole-zero diagram for the discrete-time system function
% H(z)=b(z)/a(z) defined by numerator and denominator polynomials b and a.
la=length(a);
lb=length(b);
if (la>lb),
b= [b zeros(1,la-lb)] ;
elseif (lb>la),
a= [a zeros(1,lb-la)] ;
end
ps = roots(a) ;
zs = roots(b) ;
mx = max(abs([ps' zs' .95]))+0.05;
clf
axis ([-mx mx -mx mx]);
axis('equal');
hold on
w=[0:0.01:2*pi];
plot(cos(w),sin(w),'.');
plot([-mx mx],[0 0]);
plot([0 0],[-mx mx]);
text(0.1,1.1,'Im','sc');
text(l.l,0.1,'Re','sc');
plot(real(ps),imag(ps),'x');
plot(real(zs),imag(zs),'o');
numz=sum(abs(zs)==0);
nump=sum(abs(ps)==0);
if numz>l,
text(-0.1,-0.1,num2str(numz));
elseif nump>l,
text(-0.1,-0.1,num2str(nump));
end
hold off ;
error:when running m-file: ??? Input argument "a" is undefined. Error in ==> dpzplot at 5 la=length(a); what should i do? Last edited by v0id; 02-17-2008 at 09:43 AM. |
| Sponsored Links |
|
|
|
|||
|
tanx for answer,i forgot to say i'm a beginner and tanx for code-tag u add.
but what should be changed that i could run the program Last edited by Reza; 02-18-2008 at 05:16 AM. |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| SecurityAudit | vinay | Visual Basic Programming | 27 | 01-07-2008 01:14 PM |
| multi-pass preprocessing | kenna | C and C++ | 11 | 08-14-2007 11:45 AM |
| Reg Fucntion pointers | sowmi | C and C++ | 9 | 07-29-2007 04:29 AM |
| small help in this generator function plz | SamehSpiky | C and C++ | 3 | 06-22-2007 12:47 PM |
| WingedPanther | ........ | 2753.6 |
| Xav | ........ | 2704 |
| Brandon W | ........ | 1702.32 |
| John | ........ | 1207.73 |
| marwex89 | ........ | 1175.24 |
| morefood2001 | ........ | 966.05 |
| dcs | ........ | 655.75 |
| Steve.L | ........ | 475.59 |
| orjan | ........ | 418.58 |
| Aereshaa | ........ | 383.54 |
Goal: 100,000 Posts
Complete: 98%