figure_yp

PURPOSE ^

SYNOPSIS ^

function h = figure_yp(number,name,cmd)

DESCRIPTION ^

 This function creates a figure with more flexible possible that given in Matlab 

 INPUTS

       - number: figure number [1,1]
       - name: figure name [1,n]
       - cmd: command associated to the figure creation [1,n]

 OUTPUTS
       
       - h: figure handle [1,1]

 by Y. Peysson (CEA-IRFM,yves.peysson@cea.fr) and J. Decker (joan.decker@cea.fr)

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function h = figure_yp(number,name,cmd)
0002 %
0003 % This function creates a figure with more flexible possible that given in Matlab
0004 %
0005 % INPUTS
0006 %
0007 %       - number: figure number [1,1]
0008 %       - name: figure name [1,n]
0009 %       - cmd: command associated to the figure creation [1,n]
0010 %
0011 % OUTPUTS
0012 %
0013 %       - h: figure handle [1,1]
0014 %
0015 % by Y. Peysson (CEA-IRFM,yves.peysson@cea.fr) and J. Decker (joan.decker@cea.fr)
0016 %
0017 fh = findall(0,'type','figure');%find the list of existing figures
0018 %
0019 if nargin == 0,
0020     if isempty(fh),
0021         h = figure(1);
0022     else
0023         h = figure(max(length(fh))+1);
0024     end
0025 else
0026     if number > 0 & ~isempty(number) & ~isnan(number),
0027         h = figure(number);
0028     else
0029         if isempty(fh),
0030             h = figure(1);
0031         else
0032             h = figure(max(length(fh))+1);
0033         end
0034     end
0035     %
0036     if nargin >= 2,
0037         if ~isempty(name)
0038             set(h,'name',name)
0039         end
0040     end
0041     %
0042     if nargin >= 3,
0043         if ~isempty(cmd)
0044             eval(cmd);
0045         end
0046     end
0047 end
0048     
0049     
0050     
0051     
0052     
0053

Community support and wiki are available on Redmine. Last update: 18-Apr-2019.