Create empty Simulink system
new_system(sys, model, subsystem_path)
new_system(sys, model, 'ErrorIfShadowed')
h = new_system(sys)
new_system(sys) or new_system(sys, model) creates an empty system where sys is the name of the new system. This command displays an error if sys is a MATLAB® keyword, 'simulink', or more than 63 characters long.
new_system(sys, model, subsystem_path) creates a system from a subsystem where subsystem_path is the full path of the subsystem. The model that contains the subsystem must be open when this command is executed.
new_system(sys, model, 'ErrorIfShadowed') creates an empty system having the specified name. This command generates an error if another model, MATLAB file, or variable of the same name exists on the MATLAB path or workspace.
new_system(sys, 'Library') creates an empty library.
h = new_system(sys) returns the numeric handle of the system that has been created. You can pass h to any of the Simulink® API functions, for example, open_system(h).
This command creates a new system named 'mysys'.
creates, but does not open, a new library named 'sys'.
returns an error because 'vdp' is the name of a model on the MATLAB path.
create a new model named mycontroller that has the same contents as does the subsystem named Controller in the f14 model.
h = new_system('mymodel') h = 3.0012 >> get_param(h,'Name') ans = mymodel open_system(h)
return the numeric handle of the system that has been created, and use that handle to get parameters and open the model.