Reputation: 991
I would like to display some information about a Simulink model, without first knowing the filename. The information will be displayed in the model itself.
Something similar, mfilename, is available for MATLAB programs. Is there an equivalent for Simulink models?
Upvotes: 3
Views: 7924
Reputation: 31
I think it may be more reliable to get the model parameter in case there is more than one matching model in your path:
model_path = get_param(bdroot, 'FileName');
Upvotes: 3
Reputation: 991
Thanks to Edric I found bdroot
, which gives the system name.
Passing this to which
makes Matlab find the model using it's search path.
So the solution is model_path = which (bdroot);
One problem is that if you have shadowed files this method may give the incorrect answer.
Upvotes: 4
Reputation: 25160
I think you need gcs
http://www.mathworks.com/help/toolbox/simulink/slref/gcs.html
Upvotes: 0