globalmatrix

PURPOSE ^

GLOBALMATRIX - constructor for globalmatrix object

SYNOPSIS ^

function globalmatrix = globalmatrix(varargin)

DESCRIPTION ^

GLOBALMATRIX - constructor for globalmatrix object

   Usage:
      globalmatrix = globalmatrix(varargin)

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function globalmatrix = globalmatrix(varargin)
0002 %GLOBALMATRIX - constructor for globalmatrix object
0003 %
0004 %   Usage:
0005 %      globalmatrix = globalmatrix(varargin)
0006 
0007 switch nargin
0008 case 0
0009     % if no input arguments, create a default object
0010     globalmatrix.nrows=NaN;
0011     globalmatrix.matrix=NaN;
0012     
0013     globalmatrix=class(globalmatrix,'globalmatrix');
0014 case 1
0015     %If single argument we have a copy constructor.
0016     argument = varargin{1};
0017     if isa(argument,'globalmatrix'),
0018         globalmatrix=argument;
0019     else 
0020         if isnumeric(varargin{1}),
0021             numdof=argument;
0022             globalmatrix.nrows=numdof;
0023             globalmatrix.matrix=sparse(numdof,numdof,0);
0024 
0025             globalmatrix=class(globalmatrix,'globalmatrix');
0026         elseif isstruct(argument),
0027             globalmatrix=class(argument,'globalmatrix');
0028         else
0029             error('elemmmatrix constructor error message: invalid input argument');
0030         end
0031     end
0032 otherwise
0033     error('globalmatrix constructor error message: 0 of 1 argument only in input.');
0034 end

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