Variable function names in Simulink

Hi,
I have created a model in Simulink which uses the Matlab Function block. Usuually I would enter the name of my function into this block and run the model. However I would like to automate my simulations which requires me to keep the function names variable. I have tried creating a cell array of function names and attempting to access these in the 'Matlab Function' parameter line:
SimControllers{ControllerRun}
But this does not seem to work.
Any ideas on how I could accomplish this?
Regards,
Avi

回答 (2 件)

Kaustubha Govind
Kaustubha Govind 2011 年 5 月 3 日

0 投票

You could try entering something like:
feval(SimControllers{ControllerRun},u(1))
Avishek
Avishek 2011 年 5 月 4 日

0 投票

I've for the meantime created a function which is consistently called. This function contains a call to the required function which can be variable by changing a global variable. I will compare this to your method for speed and see which is faster.
Regards
Avi

カテゴリ

ヘルプ センター および File ExchangeSimulink についてさらに検索

製品

質問済み:

2011 年 5 月 3 日

Community Treasure Hunt

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

Start Hunting!

Translated by