comparison scripts/control/base/nyquist.m @ 5215:32c569794216

[project @ 2005-03-16 18:54:42 by jwe]
author jwe
date Wed, 16 Mar 2005 18:54:52 +0000
parents bdbee5282954
children 4c8a2e4e0717
comparison
equal deleted inserted replaced
5214:eecc24b92d97 5215:32c569794216
133 ## No output arguments, then display plot, otherwise return data. 133 ## No output arguments, then display plot, otherwise return data.
134 if (nargout == 0) 134 if (nargout == 0)
135 dnplot = 0; 135 dnplot = 0;
136 while(!dnplot) 136 while(!dnplot)
137 oneplot(); 137 oneplot();
138 gset key; 138 __gnuplot_set__ key;
139 clearplot(); 139 clearplot();
140 grid ("on"); 140 grid ("on");
141 gset data style lines; 141 __gnuplot_set__ data style lines;
142 142
143 if(is_digital(sys)) 143 if(is_digital(sys))
144 tstr = " G(e^{jw}) "; 144 tstr = " G(e^{jw}) ";
145 else 145 else
146 tstr = " G(jw) "; 146 tstr = " G(jw) ";
152 if(is_siso(sys)) 152 if(is_siso(sys))
153 title(sprintf("Nyquist plot from %s to %s, w (rad/s) in [%e, %e]", ... 153 title(sprintf("Nyquist plot from %s to %s, w (rad/s) in [%e, %e]", ...
154 inn{1}, outn{1}, w(1), w(length(w))) ) 154 inn{1}, outn{1}, w(1), w(length(w))) )
155 endif 155 endif
156 156
157 gset nologscale xy; 157 __gnuplot_set__ nologscale xy;
158 158
159 axis(axis2dlim([[vec(realp),vec(imagp)];[vec(realp),-vec(imagp)]])); 159 axis(axis2dlim([[vec(realp),vec(imagp)];[vec(realp),-vec(imagp)]]));
160 plot(realp,imagp,"- ;+w;",realp,-imagp,"-@ ;-w;"); 160 plot(realp,imagp,"- ;+w;",realp,-imagp,"-@ ;-w;");
161 161
162 ## check for interactive plots 162 ## check for interactive plots