home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 10 / 10.iso / l / l460 / 2.ddi / GENERAL.DI$ / INQUIRE.M < prev    next >
Encoding:
Text File  |  1993-03-07  |  4.4 KB  |  165 lines

  1. function [a,b] = inquire(arg1)
  2. %INQUIRE  MATLAB internal states.
  3. %    INQUIRE('echo') returns 1 if ECHO is on, 0 if ECHO is off.
  4. %    INQUIRE('casesen') returns 1 if CASESEN is on, 0 if off. 
  5. %    INQUIRE('hold') returns 1 if HOLD is on, 0 if HOLD is off.
  6. %
  7. %    [S,V] = INQUIRE('axis') returns S=0 if AXIS is autoranging,
  8. %    S=1 if the AXIS is frozen.  Vector V contains the current
  9. %    axis limits, V = [Xmin Xmax Ymin Ymax].
  10. %
  11. %    INQUIRE('subplot') returns the current SUBPLOT state, e.g.
  12. %    111, 211, 223, etc.
  13. %
  14. %    [F,D] = INQUIRE('format') returns strings F and D such that
  15. %    EVAL(F),EVAL(D) would restore the current format state. 
  16. %    F is a string like 'format short e' or 'format hex'.
  17. %    D is either 'format compact' or 'format loose'.
  18. %
  19. %    [S,FNAME] = INQUIRE('diary') returns S=0 if the diary is
  20. %    off, S=1 if the diary is on, and the name of the current
  21. %    diary file in FNAME.  FNAME is empty if no file is named.
  22. %
  23. %    This function is obsolete.  Please use GET to inquire
  24. %    state values.
  25.  
  26. %    Copyright (c) 1984-93 by The MathWorks, Inc.
  27.  
  28. disp('This usage of inquire(''property'') is obsolete and will be eliminated in future')
  29. disp('versions.  Please use get(handle,''property'') instead.')
  30. if nargin < 1
  31.     error('Must be one input argument.');
  32. end
  33.  
  34. if strcmp(arg1,'hold')
  35.     cax = gca;
  36.     next = lower(get(cax,'NextPlot'));
  37.     a = strcmp(next,'add') & strcmp('add',lower(get(gcf,'NextPlot')));
  38. elseif strcmp(arg1,'axis')
  39.     a1 = axis('state');
  40.     if strcmp(a1,'auto')
  41.         a = 0;
  42.     else
  43.         a = 1;
  44.     end
  45.     b = axis;
  46. elseif strcmp(arg1,'echo')
  47.     a1 = get(0,'echo');
  48.     if strcmp(a1,'on')
  49.         a = 1;
  50.     else
  51.         a = 0;
  52.     end
  53. elseif strcmp(arg1,'casesen')
  54.     a1 = get(0,'casesen');
  55.     if strcmp(a1,'on')
  56.         a = 1;
  57.     else
  58.         a = 0;
  59.     end
  60. elseif strcmp(arg1,'format')
  61.     a = get(0,'format');
  62.     b = get(0,'formatspacing');
  63. elseif strcmp(arg1,'diary')
  64.     a1 = get(0,'diary');
  65.     if strcmp(a1,'on')
  66.         a = 1;
  67.     else
  68.         a = 0;
  69.     end
  70.     b = get(0,'diaryfile');
  71. elseif strcmp(arg1,'subplot');
  72.     rect = get(gca,'position');
  73.     table = [ 0.13   0.11  0.77 0.81
  74.    0.13   0.11   0.3175   0.81
  75.    0.5825   0.11   0.3175   0.81
  76.    0.13   0.11   0.17566666666667   0.81
  77.    0.42716666666667   0.11   0.17566666666667   0.81
  78.    0.72433333333333   0.11   0.17566666666667   0.81
  79.    0.13   0.5825   0.77   0.3375
  80.    0.13   0.11   0.77   0.3375
  81.    0.13   0.5825   0.3175   0.3375
  82.    0.5825   0.5825   0.3175   0.3375
  83.    0.13   0.11   0.3175   0.3375
  84.    0.5825   0.11   0.3175   0.3375
  85.    0.13   0.5825   0.17566666666667   0.3375
  86.    0.42716666666667   0.5825   0.17566666666667   0.3375
  87.    0.72433333333333   0.5825   0.17566666666667   0.3375
  88.    0.13   0.11   0.17566666666667   0.3375
  89.    0.42716666666667   0.11   0.17566666666667   0.3375
  90.    0.72433333333333   0.11   0.17566666666667   0.3375
  91.    0.13   0.7310   0.77   0.1890
  92.    0.13   0.4205   0.77   0.1890
  93.    0.13   0.11   0.77   0.1890
  94.    0.13   0.7310   0.3175   0.1890
  95.    0.5825   0.7310   0.3175   0.1890
  96.    0.13   0.4205   0.3175   0.1890
  97.    0.5825   0.4205   0.3175   0.1890
  98.    0.13   0.11   0.3175   0.1890
  99.    0.5825   0.11   0.3175   0.1890
  100.    0.13   0.7310   0.17566666666667   0.1890
  101.    0.42716666666667   0.7310   0.17566666666667   0.1890
  102.    0.72433333333333   0.7310   0.17566666666667   0.1890
  103.    0.13   0.4205   0.17566666666667   0.1890
  104.    0.42716666666667   0.4205   0.17566666666667   0.1890
  105.    0.72433333333333   0.4205   0.17566666666667   0.1890
  106.    0.13   0.11   0.17566666666667   0.1890
  107.    0.42716666666667   0.11   0.17566666666667   0.189
  108.    0.72433333333333   0.11   0.17566666666667   0.189];
  109.     [m,n] = size(table);
  110.     ind = [
  111.      1     1     1
  112.      1     2     1
  113.      1     2     2
  114.      1     3     1
  115.      1     3     2
  116.      1     3     3
  117.      2     1     1
  118.      2     1     2
  119.      2     2     1
  120.      2     2     2
  121.      2     2     3
  122.      2     2     4
  123.      2     3     1
  124.      2     3     2
  125.      2     3     3
  126.      2     3     4
  127.      2     3     5
  128.      2     3     6
  129.      3     1     1
  130.      3     1     2
  131.      3     1     3
  132.      3     2     1
  133.      3     2     2
  134.      3     2     3
  135.      3     2     4
  136.      3     2     5
  137.      3     2     6
  138.      3     3     1
  139.      3     3     2
  140.      3     3     3
  141.      3     3     4
  142.      3     3     5
  143.      3     3     6
  144.      3     3     7
  145.      3     3     8
  146.      3     3     9];
  147.     a = nan;
  148.     for i = 1:m
  149.         if norm(table(i,:)-rect) < .00001
  150.             a = 100*ind(i,1)+10*ind(i,2)+ind(i,3);
  151.             break;
  152.         end
  153.     end
  154. else
  155.     error(['OPTION ',arg1,' is unknown.']);
  156. end
  157.  
  158.  
  159.  
  160.  
  161.  
  162.  
  163.  
  164.  
  165.