


SPC - constructor for spc object
Usage:
spc = spc(varargin)

0001 function spc = spc(varargin) 0002 %SPC - constructor for spc object 0003 % 0004 % Usage: 0005 % spc = spc(varargin) 0006 0007 switch nargin 0008 case 0 0009 % if no input arguments, create a default object 0010 spc.type='spc'; 0011 spc.grid=NaN; %grid number for this constraint 0012 spc.dof=NaN; %c is the dof for the corresponding constraint ( 1<=c<=6, for all (x,y,z) deformations + (x,y,z) rotations) 0013 spc.value=NaN; %d is the value of the constraint. 0014 spc=class(spc,'spc'); 0015 0016 case 1 0017 %If single argument of class spc, we have a copy constructor. 0018 if (isa(varargin{1},'spc')) 0019 spc = varargin{1}; 0020 else 0021 error('spc constructor error message: copy constructor called on a non ''spc'' class object'); 0022 end 0023 otherwise 0024 error('spc constructor error message: 0 of 1 argument only in input.'); 0025 end