채택된 답변

Kaustubha Govind
Kaustubha Govind 2012년 1월 23일

2 개 추천

To call MATLAB code from a Simulink model, use one of the three MATLAB Function Blocks available. To run Simulink models from MATLAB, use the sim command. Also see Command Line Functionality for Simulink.

댓글 수: 7

Krishnendu Mukherjee
Krishnendu Mukherjee 2012년 1월 24일
actually i want to run a model through a m-file.
actually i have an circuit on dc motor speed control. to optimize the pi controller an optimizing algorithm(ICA) is required,which is in m-file. i want to run the m-file but the model should also be called through the m-file as required. plz help in this topic.
TAB
TAB 2012년 1월 25일
Use sim() command to run simulink model from m-file.
See
>> doc sim
Krishnendu Mukherjee
Krishnendu Mukherjee 2012년 1월 26일
ok.if i use sim('modelname');.then only the model is processing.but how to get the simulated data.means in the modal if i want to get a perticular output/signal.then what command should i use?
Kaustubha Govind
Kaustubha Govind 2012년 1월 26일
Connect an Outport block to the signal that you need to log. The sim() command returns it in the 'Y' if using the "[T,X,Y] =sim('model',Timespan, Options, UT)" syntax, and in simOut.get('yout'); if using the newer "simOut = sim('model','SaveOutput','on','OutputSaveName','yout')" syntax.
Balvinder Singh
Balvinder Singh 2019년 3월 30일
can we use this command for two plant in simulation. kindly suggest the proper format of command for two different plant in same simulation
Md Toukir Hasan
Md Toukir Hasan 2021년 1월 24일
What is the actual syntax of calling simulink file in matlab script? Version is 2020b. Quick response please
Steven Lord
Steven Lord 2021년 1월 25일
https://www.mathworks.com/help/simulink/run-individual-simulations.html

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

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Simulink Environment Customization에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by