How to use Mechanics Explorer with parsim?

I have a Simscape model with a case matrix for various bounds that were run. The model has all data logging enabled, but not mirrored to Data Inspector. There are separate signals output to SDI. I can run the model from command line with sim and it will open Mechanics Explorer and play the animation. I can review data in Simulink.sdi.createRun and sscexplore.
Now...if I do something like...
results = parsim(in, 'ShowProgress','on');
I get results which can be viewed like:
sscexplore(results(1).simlog)
Simulink.sdi.createRun('Batch Run 1','vars', results(1).logsout);
Simulink.sdi.view
Is there a way to get Mechanic Explorer to launch and show the animation?

2 comentarios

Broy
Broy el 23 de En. de 2026
@Matthew, Since you are already successfully retrieving the simlog (as seen in your sscexplore command), you just need to load this data into the Mechanics Explorer interface manually.
Matthew
Matthew el 23 de En. de 2026
@Broy How? If I save the output structure as a mat file and open that with Mechanics Explorer, status bar says: "Variables created in current workspace". And it simply loads the mat file.
If I choose import data and select the mat file...again nothing. This is true whether or not the matfile as the entire parsim output or just a single run. In fact the help contained within the import UI is for video and audio files.
Mechanics Explorer itself doesn't open unless I open a simscape model and either compile it or run a simulation. I have been unable to locate the command line version of Mechanics Explorer.
The root of my question is how to do exactly what you suggest.

Iniciar sesión para comentar.

 Respuesta aceptada

Yifeng Tang
Yifeng Tang el 3 de Feb. de 2026

0 votos

There is a workaround. It's orginally developed to allow animation from multibody model executed on realtime target machines (HIL testing), and I think it'll work in your case, too.
The basic idea is:
  1. attach a bushing joint to ALL solid parts (sphere, extrude, file, cubic, etc.), log p_xyz and q_xyz (position and angle).
  2. gather all logged position and angle via goto & from labels, mux together and save to workspace.
  3. Step 1~2 will give you a "simulation model" that'll produce the position and orientation of every solid at each time step.
  4. make a copy of every solid from the original model, attach a bushing joint to each, and drive the joint using p_xyz & q_xyz inputs.
  5. demux logged simulation signal from 3, use goto labels and assign to the right joint.
  6. Step 4-5 now give you an "animation" model that'll replay the results from 3 by moving each part to the right location at each time step. without doing any of the actual multibody calculation (because there isn't an actual joint anymore).
All these steps can be automated using MATLAB scripts. Please reach out to MathWorks Application Engineering via your account manager or contact Tech Support to access them. Some customization may be needed to suit your specific needs.
Hope this helps.

Más respuestas (0)

Categorías

Más información sobre Simscape Multibody en Centro de ayuda y File Exchange.

Productos

Versión

R2024b

Etiquetas

Preguntada:

el 20 de En. de 2026

Respondida:

el 3 de Feb. de 2026

Community Treasure Hunt

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

Start Hunting!

Translated by