Products & Services Solutions Academia Support User Community Company

Learn more about Simulink   

Creating an Empty Model

To create an empty model, click the New button on the Library Browser's toolbar, or choose New from the library window's File menu and select Model. An empty model is created in memory and it is displayed in a new model editor window.

Creating a Model Template

When you create a model, Simulink uses defaults for many configuration parameters. For example, by default new models have a white canvas, the ode45 solver, and a visible toolbar. If these or other defaults do not meet your needs, you can use the Simulink software model construction commands described in Model Construction to write a function that creates a model with the defaults you prefer. For example, the following function creates a model that has a green canvas and a hidden toolbar, and uses the ode3 solver:

function new_model(modelname) 
% NEW_MODEL Create a new, empty Simulink model
%    NEW_MODEL('MODELNAME') creates a new model with
%    the name 'MODELNAME'. Without the 'MODELNAME'
%    argument, the new model is named 'my_untitled'.

if nargin == 0 
     modelname = 'my_untitled';
end 

% create and open the model
open_system(new_system(modelname));

% set default screen color
set_param(modelname, 'ScreenColor', 'green');

% set default solver
set_param(modelname, 'Solver', 'ode3');

% set default toolbar visibility
set_param(modelname, 'Toolbar', 'off');

% save the model
save_system(modelname);
  


Related Products & Applications

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.

 © 1984-2009- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS