home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 10 / 10.iso / l / l455 / 2.ddi / MUTOOLS1.DI$ / VZOOM.M < prev    next >
Encoding:
Text File  |  1993-03-11  |  1.3 KB  |  47 lines

  1. %function vzoom('axis')
  2. %
  3. %   VZOOM freezes axis by clicking on 2 points in the plot.
  4. %   STR is a string variable:
  5. %    'ss'  standard plot  (default)
  6. %    'll'  log-log
  7. %    'ls'  semilogx
  8. %    'sl'  semilogy
  9. %
  10. %   Also, STR can be any allowable input to VPLOT, except 'bode'.
  11. %     Example:    
  12. %              tf = frsp(nd2sys([ 1 .1],[.1 1]),logspace(-2,2,100));
  13. %           vplot('nic',tf); vzoom('nic'); vplot('nic',tf);axis;
  14. %
  15. %   See Also: GINPUT and VPLOT.
  16.  
  17. function vzoom(str)
  18.  
  19.  if nargin == 0
  20.     disp('usage: vzoom(''axis'')');
  21.     return;
  22.  end
  23.  
  24. if strcmp(str,'ss')|strcmp(str,'iv,d')|strcmp(str,'iv,m')|strcmp(str,'iv,p')...
  25.         |strcmp(str,'ri')|strcmp(str,'nyq')|strcmp(str,'nic')
  26.     [x,y]=ginput(2);
  27.     axis([min(x) max(x) min(y) max(y)]);
  28. elseif strcmp(str,'ll')|strcmp(str,'liv,lm')
  29.     [x,y]=ginput(2);
  30.     axis(log10([min(x) max(x) min(y) max(y)]));
  31. elseif strcmp(str,'ls')|strcmp(str,'liv,d')|strcmp(str,'liv,m')|...
  32.         strcmp(str,'liv,p')
  33.     [x,y]=ginput(2);
  34.     axis([log10([min(x) max(x)]) min(y) max(y)]);
  35. elseif strcmp(str,'sl')|strcmp(str,'iv,lm')
  36.     [x,y]=ginput(2);
  37.     axis([min(x) max(x) log10([min(y) max(y)]) ]);
  38. elseif strcmp(str,'bode')
  39.     disp('This function not defined for bode plots');
  40. else
  41.     disp(['This function not defined for: ' str]);
  42. end %if
  43.  
  44.  
  45. %
  46. % Copyright MUSYN INC 1991,  All Rights Reserved
  47.