Can I pass the model name into the ([],[],[],'compile') command?

for example, it at first works with f14([],[],[],'compile'); But now i want to write this command into a function, and i want to do something like this: function compile(MyModel) MyModel([],[],[],'compile');
-------------- And MyModel is some name i will pass in. When i try to do this it prompt some error to me. "??? Index exceeds matrix dimensions." Why?
Thank you very much.

 채택된 답변

Kaustubha Govind
Kaustubha Govind 2011년 12월 9일

1 개 추천

Try:
function compile(MyModel)
eval([MyModel '([],[],[],''compile'')']);

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Configure and View Diagnostics에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by