Index: mttroot/mtt/bin/trans/m/equation.m ================================================================== --- mttroot/mtt/bin/trans/m/equation.m +++ mttroot/mtt/bin/trans/m/equation.m @@ -15,10 +15,14 @@ % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % %% Version control history % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % %% $Id$ % %% $Log$ +% %% Revision 1.4 1996/09/12 16:42:01 peter +% %% Default now out side this function - need to be none for each +% %% component. +% %% % %% Revision 1.3 1996/09/12 12:03:58 peter % %% Added some error checking. % %% If no constitutive relationship, only add diagonal elementts to % %% default unity output. % %% @@ -46,11 +50,11 @@ % Set up LHS LHS = varname(name, outbond, outcause); % Set up various strings to get correct syntax if some strings are empty -if length(cr)==0 +if strcmp(cr,'') cause_name = ''; port_name = ''; lp = ''; rp = ''; c_comma = ''; @@ -60,11 +64,11 @@ lp = '('; rp = ')'; c_comma = ','; end -if length(args)==0 +if strcmp(args,'') a_comma = ''; else a_comma = ','; end; @@ -75,13 +79,13 @@ % Set up rest of RHS - the input variables, causality and ports. RHS2 = ''; for i=1:nports RHS2 = sprintf('%s\t%s', ... - RHS2, varname(name, inbonds(i), incauses(i))) + RHS2, varname(name, inbonds(i), incauses(i))); - if length(cr)>0 % add the causality & port info + if strcmp(cr,'')==0 % add the causality & port info RHS2 = sprintf('%s,%s,%1.0f', ... RHS2, cause2name(incauses(i)), inports(i)); end; if (i