addnote

PURPOSE ^

ADDNOTE - add a note to the existing model notes field

SYNOPSIS ^

function md=addnote(md,string)

DESCRIPTION ^

ADDNOTE - add a note to the existing model notes field

   Usage:
      md=addnote(md,string);

   Example:
      md=addnote(md,'Pine Island, Geometry of 2007');

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SUBFUNCTIONS ^

SOURCE CODE ^

0001 function md=addnote(md,string)
0002 %ADDNOTE - add a note to the existing model notes field
0003 %
0004 %   Usage:
0005 %      md=addnote(md,string);
0006 %
0007 %   Example:
0008 %      md=addnote(md,'Pine Island, Geometry of 2007');
0009 
0010 if (nargin~=2) | (nargout~=1),
0011     addnoteusage;
0012     error(' ');
0013 end
0014 
0015 if ~ischar(string),
0016     error('addnote error message: second input argument should be a string');
0017 end
0018 notes=md.notes;
0019 
0020 if ischar(notes),
0021     newnotes=cell(2,1);
0022     newnotes(1)={notes};
0023     newnotes(2)={string};
0024 else
0025     newnotes=cell(length(notes)+1,1);
0026     for i=1:length(notes),
0027         newnotes(i)=notes(i);
0028     end
0029     newnotes(length(notes)+1)={string};
0030 end
0031 
0032 md.notes=newnotes;
0033 
0034 function addnoteusage()
0035 disp('addnote usage:');
0036 disp('   model=addnote(model,string)');

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