Hello.
I want to plot a trajectory into the Mechanics Explorer using the Spline block.
I looked at the Steve Miller example (Four Bar Linkage Optimization in Simscape - File Exchange - MATLAB Central (mathworks.com)) and cannot figure out why it doesn't work.
I have a Matlab variable with the x and y cooordinates called anyOldSpline. Modifying End Conditions has no effect.
The result is one single marker at [0 0] which isn't even part of the spline array.
Can anyone help? Thanks in advance

 Akzeptierte Antwort

Steve Miller
Steve Miller am 6 Dez. 2022

0 Stimmen

From what I see, it should be just fine. Normally, your spline should be nx3, but I also tried entering nx2 and still saw it plot properly both in the block dialog box and in the Mechanics Explorer.
Things to try:
  1. Have you tried changing the level of zoom? Perhaps you are too far away to see the line and can only see the markers (spheres)
  2. Is there a solid sphere with a very large radius hiding the spline?
--Steve

4 Kommentare

Tobias Panitz
Tobias Panitz am 7 Dez. 2022
Thanks for the reply Steve.
So things I have tried:
  • adding a z-coordinate to anyOldSpline
  • Zooming in and out as far as possible
  • Try it in a different model
  • change the units
  • transform the vector
  • add only positive values
  • change the marker
Nothing seems to be working.
Maybe there is an alternative? I'm trying to porject a line into the mechanics explorer so I can see the vehicle movement relative to the path it is supposed to follow.
Steve Miller
Steve Miller am 7 Dez. 2022
Upload your model and I can check it more closely.
--Steve
Tobias Panitz
Tobias Panitz am 7 Dez. 2022
Setting the graphics type to From Geometry did the trick.
Steve Miller
Steve Miller am 7 Dez. 2022
Great! I should have seen that in your dialog box setting above. Thanks for letting me know.
--Steve

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Produkte

Version

R2022a

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by