Embed SimMechanics Visualization in MATLAB GUI
조회 수: 2 (최근 30일)
이전 댓글 표시
I have a MATLAB GUI that will run a SimMechanics model and would like to embed the visualization window in the GUI. Is there any way to do this? I have seen people suggest saving the visualization as an avi file, which wouldn't allow for interaction (which would be ideal), but I'll take what I can get. If that is the only way, is there any way to automatically save a visualization as an avi file? I know there is a setting in the Simulation menu for 1st Gen SimMechanics, but I am running 2nd Gen and there doesn't seem to be any such setting. If there isn't, is there any way to save the visualization from the command window? And from there, how would I be able to run the avi animation on the axes?
댓글 수: 0
답변 (1개)
Steve Miller
2018년 3월 8일
I do not believe there is a way to embed the Mechanics Explorer in a MATLAB GUI. You can, however, dock the Mechanics Explorer in the MATLAB desktop, which will give you the same effect.
You can generate videos from the Mechanics Explorer from the command line using the command smwritevideo
To control the viewpoint of your video, you can define cameras within the Mechanics Explorer. The location and orientation of the camera can change during the animation of the simulation results, and those results can be exported to a video.
Below is an example of an animation exported from the Simscape Multibody Mechanics Explorer with a dynamic camera. The camera can also be configured to track the box, always keeping it in the center of the frame. This example is available on the File Exchange: Robot Arm with Conveyor Belts.
--Steve
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Simulation and Analysis에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!