display

PURPOSE ^

DISPLAY - display the fields of a model

SYNOPSIS ^

function display(a)

DESCRIPTION ^

DISPLAY - display the fields of a model

   echo function for 'model' class

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SUBFUNCTIONS ^

SOURCE CODE ^

0001 function display(a)
0002 %DISPLAY - display the fields of a model
0003 %
0004 %   echo function for 'model' class
0005     
0006 disp(sprintf('\n%s = \n',inputname(1)));
0007 disp(sprintf('%s%s%s','   Mesh: type ''',inputname(1),'.mesh'' to display'));
0008 disp(sprintf('%s%s%s','   Boundary conditions: type ''',inputname(1),'.bc'' to display'));
0009 
0010 if(a.numrifts)disp(sprintf('      rifts: %i',a.numrifts));end
0011 
0012 disp(sprintf('%s%s%s','   Observations: type ''',inputname(1),'.obs'' to display'));
0013 disp(sprintf('%s%s%s','   Materials: type ''',inputname(1),'.mat'' to display'));
0014 disp(sprintf('%s%s%s','   Parameters: type ''',inputname(1),'.par'' to display'));
0015 disp(sprintf('%s%s%s','   Solution parameters: type ''',inputname(1),'.solpar'' to display'));
0016 disp(sprintf('%s%s%s','   Results: type ''',inputname(1),'.res'' to display'));
0017 disp(sprintf('%s%s%s','   ExpPar: type ''',inputname(1),'.exppar'' to display'));
0018 disp(sprintf('%s%s%s','   Qmu: type ''',inputname(1),'.qmu'' to display'));
0019 
0020 %Diverse
0021 disp(sprintf('   Miscellaneous:'));
0022 if isempty(a.name),
0023     disp(sprintf('      name: N/A'));
0024 else
0025     disp(sprintf('      name: %s',a.name));
0026 end
0027 
0028 %notes: a.notes is a cell array of strings
0029 if isempty(a.notes),
0030     disp(sprintf('      notes: N/A'));
0031 else
0032     if iscell(a.notes),
0033         strings=a.notes;
0034         for i=1:length(strings),
0035             string=char(strings(i));
0036             if i==1,
0037                 disp(sprintf('      notes: %s',string));
0038             else
0039                 disp(sprintf('             %s',string));
0040             end
0041         end
0042     elseif ischar(a.notes),
0043         disp(sprintf('      notes: %s',a.notes));
0044     else
0045         disp('display error message: ''notes'' for model is neither a cell array of string, nor a string. Cannot display.');
0046     end
0047 end
0048 
0049 %repository
0050 if ~isempty(a.repository),
0051     disp(sprintf('      repository: %s',a.repository));
0052 end
0053 
0054 
0055 end
0056 
0057 function struct_display(structure,offset)
0058 disp(sprintf('%s',[offset '1x' num2str(size(structure,2)) ' struct array with fields:']));
0059 structure_fields=fields(structure);
0060 for i=1:length(structure_fields),
0061     disp(sprintf('%s',[offset '   ' structure_fields{i}]));
0062 end
0063 
0064 end

Generated on Sun 29-Mar-2009 20:22:55 by m2html © 2003