MATLAB: How do you simulate a simulink model using a string?

  • Follow


Hey guys can you please help with this, I just cant get it.

I have a simulink model with the name BusAssignment and with that I have an edit box inside a GUI with a string BusAssignment. I am trying to get the mfile to read the String and simulate it as it is the name of the simulink model.

At the moment I have the follow piece of code for that section


SimulinkName = get(handles.simulinkname, 'String'); %takes the simulink model name

sim(SimulinkName) %runs the simulink model


SimulinkName gives back BusAssignment but when it goes to sim it trys to simulate SimulinkName which is not right and give this error:

??? Error using ==> GUIForProject>student_SelectionChangeFcn at 1280
Unable to open file for reading: "SimulinkName.mdl".

For it to work I need it to do the following

sim('BusAssignment')



Any suggestions? 
0
Reply Conor 11/26/2010 3:58:04 PM


0 Replies
352 Views

(page loaded in 0.019 seconds)

Similiar Articles:













7/22/2012 3:57:48 AM


Reply: