필터 지우기
필터 지우기

[GUI] How do I open and run a simulation previously created in simulink?

조회 수: 1 (최근 30일)
Adriano Morais
Adriano Morais 2016년 10월 9일
편집: Geoff Hayes 2016년 10월 10일
Hello all, I've created a model of a bouncing ball using simulink, I've run the simulation and the model is working, now I've created a GUI where I want to open and run this simulation, heres the GUI: http://prntscr.com/crphoh
This is the code I've used to open the simulation model:
[filename, pathname] = uigetfile({'*.slx;*', 'Pick a .slx file'});
This is the code I've used to run the simulation:
modelname = get(handles.modelname, 'String');
stoptime = str2num(get(handles.simstoptime, 'String'));
sim(modelname, [0 stoptime])
And finally the code I used to stop the simulation: global GUIStopFlag; GUIStopFlag = 1;
So, none of those above work, I can't open the simulation model or run it, I get nothing on the GUI. Any help?
  댓글 수: 1
Preethi
Preethi 2016년 10월 10일
remove ; from
[filename, pathname] = uigetfile({'*.slx;*', 'Pick a .slx file'});
is the screenshot of GUI attached complete?

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Modeling에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by