plotmodel

PURPOSE ^

At command prompt, type plotdoc for help on documentation.

SYNOPSIS ^

function plotmodel(md,varargin)

DESCRIPTION ^

At command prompt, type plotdoc for help on documentation.

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function plotmodel(md,varargin)
0002 %At command prompt, type plotdoc for help on documentation.
0003 
0004 global ISSM_DIR
0005 if isempty(ISSM_DIR),
0006     error('ISSM_DIR variable got erased! This variable is needed to run Ice code correctly. Please rerun your startup file.');
0007 end
0008 
0009 %First go through varargin and  figure out how many subplots we are going to make
0010 datavalues=findarg(varargin,'data');
0011 numberofplots=length(datavalues);
0012 subplotwidth=ceil(sqrt(numberofplots));
0013 
0014 %Get figure number
0015 figurevalues=findarg(varargin,'figure');
0016 if ~isempty(figurevalues),
0017     if length(figurevalues)>1,
0018         error('plotmodel error message: only one figure allowed');
0019     else
0020         figurenumber=figurevalues.value;
0021     end
0022 else
0023     figurenumber=1;
0024 end
0025 
0026 %go through subplots
0027 if numberofplots,
0028         
0029     %recover options  for all subplots.
0030     options=recover_plot_options(md,varargin,numberofplots);
0031     
0032     %Create figure
0033     figure(figurenumber),clf;
0034 
0035     %Go through all data plottable
0036     for i=1:numberofplots,
0037 
0038         %call unit plot
0039         plot_unit(md,options{i},subplotwidth,i);
0040 
0041     end
0042 else
0043     error('plotmodel error message: no output data found. ');
0044 end

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