Skip to content
Snippets Groups Projects
Commit 79174f5e authored by Cristian Galperti's avatar Cristian Galperti
Browse files

template with init block, duplicate function adapted

parent 8dad3c95
No related branches found
No related tags found
No related merge requests found
File suppressed by a .gitattributes entry or the file's encoding is unsupported.
......@@ -44,4 +44,25 @@ clear elems;
busNames{end+1} = 'algo_template_bus1';
Buses{end+1} = outBus;
% init bus
elems(1)=Simulink.BusElement;
elems(1).Name='init1';
elems(1).DataType='single';
elems(2)=Simulink.BusElement;
elems(2).Name='init2';
elems(2).DataType='int32';
initBus = Simulink.Bus;
initBus.HeaderFile = '';
initBus.Description = '';
initBus.DataScope = 'Auto';
initBus.Alignment = -1;
initBus.Elements = elems;
clear elems;
% append to list
busNames{end+1} = 'algo_template_init1';
Buses{end+1} = initBus;
end
......@@ -58,7 +58,10 @@ list={{'algo_template/realtime' ,'SampleTime',}, ...
{'algo_template/signal_out' ,'OutDataTypeStr',}, ...
{'algo_template/Gain' ,'Gain'}, ...
{'algo_template/Constant' ,'OutDataTypeStr'}, ...
{'algo_template/Model' ,'ModelNameDialog'}, ...
{'algo_template/Model' ,'ModelNameDialog'}, ...
{'algo_template/InitFcn/Constant1','Value'},...
{'algo_template/InitFcn/Constant2','Value'},...
{'algo_template/InitFcn/InitOut','OutDataTypeStr',}, ...
};
load_system(['algo_' name]);
for i=1:numel(list)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment