Simulating model in command window without using workspace.

1 次查看(过去 30 天)
1. I want to simulate the model using sim method. I have parameters and corresponding values to be simulated. But i dont know how to give these values to sim method. we dont want to create the parameter and their values in workspace. How to explicitly specify these parameter and values to sim method.
2. I want to know the names of the parameter used in the model. Which method is used to get those parameter names.

回答(2 个)

Nirmal Gunaseelan
1. If I understand your question right, by parameters you mean variables that you have specified in the model's block parameters. These values have to be in the workspace when the model is simulated. If you did not want them to be present initially and want the model to be self contained, then you could create them on the fly when loading the model using Callback functions and delete them when exiting the model.
2. To find out variables that your model depends on in the workspace, you could perform a Model dependency check.
  2 个评论
Sadanand
Sadanand 2011-7-7
Thank you so much for ur response.
I am still left with the following queries.
1. When Callback function is used to load variables into workspace, variables have to be defined in .m file. How to specify values for these variables.
2. Model dependency check creates manifest file with which we can get toolbox dependency etc. but i need variable names present in model file before simulation starts.
Thanks in advance.
Nirmal Gunaseelan
1. You could either declare and define variables in some script and call it in the callback or load a MAT file containing these.
2. Manifest does give you a list of variables - check the doc page.

请先登录,再进行评论。


Paulo Silva
Paulo Silva 2011-7-7

类别

Help CenterFile Exchange 中查找有关 Modeling 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by