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.

 Accepted Answer

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

More Answers (0)

Categories

Find more on General Applications in Help Center and File Exchange

Products

Community Treasure Hunt

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

Start Hunting!