Text3D Invalid use of operator

Hi,
I'm pretty new to Matlab so I'm not very familiar with the syntax. I want to plot an Arrow with Text annotated in 3D, so I thought Text3D would be a good option. I red the documentation on https://www.mathworks.com/help/symbolic/mupad_ref/textorientation.html
If I just create a new script and copy for example, "Example 1"
p1 := plot::Point3d([1, 2, 3], PointSize = 3*unit::mm):
text1 := plot::Text3d("Hello world!", [1, 2, 3],
TextOrientation = [cos(a), sin(a), 0, 0, 0, 1],
a = 0..2*PI, TextFont = [24],
Billboarding = FALSE):
p2 := plot::Point3d([3, 6, 9], PointSize = 3*unit::mm):
text2 := plot::Text3d("MuPAD", [3, 6, 9],
TextOrientation = [1, 0, 0, 0, sin(a), cos(a)],
a = 0..2*PI, TextFont = [24],
Billboarding = FALSE):
plot(p1, text1, p2, text2)
I get a "Invalid use of operator" error. Aren't the examples working stand alone code? How can I make it work?

1 commentaire

X = rand(2,1) ;
Y = rand(2,1) ;
annotation('arrow',X,Y);

Connectez-vous pour commenter.

Réponses (1)

Steven Lord
Steven Lord le 3 Mai 2019

0 votes

This function cannot be used directly in a MATLAB script, function, or class. It can only be used in a MuPAD Notebook or by evaluating it in a MuPAD symengine.
Instead, use annotation with the 'arrow' or 'textarrow' annotation type as KSSV suggested.

1 commentaire

Sebastian Thoma
Sebastian Thoma le 27 Mai 2019
Is there any way to get some sort of perspective text orientation in MATLAB scripts as Text3D and Billboarding do?

Connectez-vous pour commenter.

Produits

Version

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by