How can I create MATLAB animations using data from Simulink 7.1 (R2008a)?

조회 수: 2 (최근 30일)
I would like to display MATLAB animations using MATLAB script in the Simulink environment.
The input data should be coming from a Simulink block and an external hardware.

채택된 답변

MathWorks Support Team
MathWorks Support Team 2022년 5월 18일
편집: MathWorks Support Team 2022년 5월 18일
There are several options you can use depending on the specific needs and constraints of your application.
To use a MATLAB script to create MATLAB animations in a Simulink environment, you can:
1. Import the script into an Embedded MATLAB Function block and make eml.extrinsic calls to use dispatch MATLAB functions to the MATLAB engine. Note the model will have to be simulated in Normal mode.
2. Use a Level 2 S-Function block and interface the MATLAB script with the S-Function API. Note the model will have to be simulated in Normal mode.
3. Use the MATLAB Compiler to compile the MATLAB script into an executable and have it interface with Simulink.
4. Other options include code generation, but that will no longer use the MATLAB script.
If you want to use real-time or near real-time animations, it introduces another layer of complexity.
The best option then would be to use Simulink 3D and Real Time Windows Target. You will then need to rewrite your MATLAB script in VRML and interface it with a Simulink-3D block. The advantage here is that Simulink-3D is compatible to Real Time Windows Target and it is designed to interface with Simulink.
Here are some demos to Simulink 3D:
Also, you could write your own C-file that does the graphical display. The C-file can be integrated with the code generation of S-Functions.

추가 답변 (0개)

카테고리

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

제품

Community Treasure Hunt

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

Start Hunting!

Translated by