18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
% Structure matrix [states,nonstates,inputs,outputs,zero_outputs]
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %% Version control history
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %% $Id$
% %% $Log$
% %% Revision 1.15 1997/12/16 18:24:33 peterg
% %% Added unknown_input to structure list
% %%
% %% Revision 1.14 1997/08/26 07:51:10 peterg
% %% Now counts the local input and outputs by order of appearence rather
% %% than by port number - it therfore handles ports with bicausality correctely.
% %%
|
>
>
>
|
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
% Structure matrix [states,nonstates,inputs,outputs,zero_outputs]
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %% Version control history
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %% $Id$
% %% $Log$
% %% Revision 1.16 1998/03/06 09:38:58 peterg
% %% Now writes correct structure file for multiport C & I
% %%
% %% Revision 1.15 1997/12/16 18:24:33 peterg
% %% Added unknown_input to structure list
% %%
% %% Revision 1.14 1997/08/26 07:51:10 peterg
% %% Now counts the local input and outputs by order of appearence rather
% %% than by port number - it therfore handles ports with bicausality correctely.
% %%
|
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
|
ese_file = fopen(ese_name, 'w');
fprintf(ese_file, '\n%s%s Equation file for system %s (file %s)\n', ...
pc, pc, full_name_repetition, ese_name);
fprintf(ese_file, '%s%s Generated by MTT\n\n', pc, pc);
% Evaluate the system function to get the bonds
eval(['[bonds,status,system_type] = ', cbg_name, ';']);
abg_name = [system_type, '_abg'];
cmp_name = [system_type, '_cmp'];
eval(['[junk,components]=', abg_name, ';']);
% Find number of bonds
[n_bonds,columns] = size(bonds);
if (columns ~= 2)&(n_bonds>0)
error('Incorrect bonds matrix: must have 2 columns');
end;
|
|
>
|
|
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
|
ese_file = fopen(ese_name, 'w');
fprintf(ese_file, '\n%s%s Equation file for system %s (file %s)\n', ...
pc, pc, full_name_repetition, ese_name);
fprintf(ese_file, '%s%s Generated by MTT\n\n', pc, pc);
% Evaluate the system function to get the bonds
eval(['[bonds,status,system_type,components] = ', cbg_name, ';']);
abg_name = [system_type, '_abg'];
cmp_name = [system_type, '_cmp'];
% No longer needed - cbg now has components:
% eval(['[junk,components]=', abg_name, ';']);
% Find number of bonds
[n_bonds,columns] = size(bonds);
if (columns ~= 2)&(n_bonds>0)
error('Incorrect bonds matrix: must have 2 columns');
end;
|