Home > classes > @ao > attachmdl.m

attachmdl

PURPOSE ^

ATTACHMDL attach an mdl file to the analysis object.

SYNOPSIS ^

function a = attachmdl(varargin)

DESCRIPTION ^

 ATTACHMDL attach an mdl file to the analysis object.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

 DESCRIPTION: ATTACHMDL attach an mdl file to the analysis object.

 CALL:        a = attachmdl(a)

 VERSION:     $Id: attachmdl.html,v 1.14 2008/03/31 10:27:34 hewitson Exp $

 HISTORY: 31-03-07 M Hewitson
             Creation

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function a = attachmdl(varargin)
0002 % ATTACHMDL attach an mdl file to the analysis object.
0003 %
0004 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0005 %
0006 % DESCRIPTION: ATTACHMDL attach an mdl file to the analysis object.
0007 %
0008 % CALL:        a = attachmdl(a)
0009 %
0010 % VERSION:     $Id: attachmdl.html,v 1.14 2008/03/31 10:27:34 hewitson Exp $
0011 %
0012 % HISTORY: 31-03-07 M Hewitson
0013 %             Creation
0014 %
0015 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0016 
0017 VERSION  = '$Id: attachmdl.html,v 1.14 2008/03/31 10:27:34 hewitson Exp $';
0018 CATEGORY = 'Helper';
0019 
0020 % Check if this is a call for parameters
0021 if nargin == 2
0022   if isa(varargin{1}, 'ao')
0023     in = varargin{2};
0024     if strcmp(in, 'Params')
0025       a = plist;
0026       return
0027     elseif strcmp(in, 'Version')
0028       a = VERSION;
0029       return
0030     elseif strcmp(in, 'Category')
0031       a = CATEGORY;
0032       return
0033     end
0034   end
0035 end
0036 
0037 a = varargin{1};
0038 
0039 % get the current mdl file
0040 mdlfile = bdroot(gcb);
0041 
0042 % read it
0043 [pathstr,name,ext,vers] = fileparts(mdlfile);
0044 if isempty(ext)
0045   mdlfile = [mdlfile '.mdl'];
0046 end
0047 
0048 
0049 mdlfilein = textread(mdlfile,'%s','delimiter','\n','whitespace','');
0050 mdlout = '';
0051 for j=1:length(mdlfilein)
0052   mdlout = [mdlout '\n' mdlfilein{j}];
0053 end
0054 a.mdlfile = strrep(mdlout, '''', '`');
0055 a.mdlfilename = mdlfile;
0056 
0057 
0058 % END

Generated on Mon 31-Mar-2008 12:20:24 by m2html © 2003