linking simulink from m-file
显示 更早的评论
采纳的回答
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 个评论
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.
Use sim() command to run simulink model from m-file.
See
>> doc sim
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?
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.
can we use this command for two plant in simulation. kindly suggest the proper format of command for two different plant in same simulation
What is the actual syntax of calling simulink file in matlab script? Version is 2020b. Quick response please
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!选择网站
选择网站以获取翻译的可用内容,以及查看当地活动和优惠。根据您的位置,我们建议您选择:。
您也可以从以下列表中选择网站:
如何获得最佳网站性能
选择中国网站(中文或英文)以获得最佳网站性能。其他 MathWorks 国家/地区网站并未针对您所在位置的访问进行优化。
美洲
- América Latina (Español)
- Canada (English)
- United States (English)
欧洲
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
