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 Comment

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

Sign in to comment.

Answers (1)

Steven Lord
Steven Lord on 3 May 2019
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 Comment

Is there any way to get some sort of perspective text orientation in MATLAB scripts as Text3D and Billboarding do?

Sign in to comment.

Products

Release

R2018a

Asked:

on 3 May 2019

Commented:

on 27 May 2019

Community Treasure Hunt

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

Start Hunting!