nnvkct
Newbie level 6
The following code creates a Simulink model that has a green canvas and a hidden toolbar and uses the ode3 solver:
function new_model(modelname)
if nargin == 0
modelname = 'my_untitled';
end
open_system(new_system(modelname));
set_param(modelname, 'ScreenColor', 'green');
set_param(modelname, 'Solver', 'ode3');
set_param(modelname, 'Toolbar', 'off');
save_system(modelname);
----------------------------------------------------------
Please explain me following questions:
- nargin (What's nargin?)
- How to execute this code in simulink?
I appreciate any help. Thanks.
function new_model(modelname)
if nargin == 0
modelname = 'my_untitled';
end
open_system(new_system(modelname));
set_param(modelname, 'ScreenColor', 'green');
set_param(modelname, 'Solver', 'ode3');
set_param(modelname, 'Toolbar', 'off');
save_system(modelname);
----------------------------------------------------------
Please explain me following questions:
- nargin (What's nargin?)
- How to execute this code in simulink?
I appreciate any help. Thanks.