Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

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

  • 26-11-2010 3:51pm
    #1
    Registered Users, Registered Users 2 Posts: 61 ✭✭


    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?


Advertisement