How do I create a Greek letter in live editor?

When I input \omega or \Omega I get the following error message "Error using syms (line 296) Invalid varialbe name. My check of valid variables: exist('omega') comes back 0. Inputing \omega in the command window gets invalid operator for the backslash.

8 Comments

@Jack please show the code that you have written that leads to the error message "error using syms...". Are you trying to write this Greek letter as text to something? Please clarify.
syms \Omega \Omega_dot
@Jack - it still isn't clear what you are trying to do. Why are you writing the code in this fashion with syms?
I am trying to create a symbolic matrix named omega
From another person who reponsded to my question, I know I violated a rule by beginning the definition with \omega
Every reference I have avaiialble says Greek letters are defined thusly:
\alpha α \upsilon υ \chi χ \beta β \psi ψ \gamma
I think your reference is for how to render the Greek letter in text..not as a variable name. (If referring to Greek Letters and Special Characters in Chart Text.
Yes, you are correct! So if I want to name my matrix Omega, I simply name it Omega and Omega_dot.
Omega__dot probably. Single underscore for subscript, double underscore for superscript
Walter - Thanks

Sign in to comment.

 Accepted Answer

Matlab variable names are not allowed to contain rich text. They must start with a-z or A-Z, after which up to 62 characters are allowed, but only a-z, A-Z, 0-9, and the underscore symbol.
All other character sequences are not valid variable names.

1 Comment

That said:
If you use the Symbolic Toolbox with Livescript then results will be rendered. Symbolic names which match Greek letters will be rendered as Greek letters.
This will not happen for traditional matlab command window and will not happen when matlab is displaying the name of the variable.

Sign in to comment.

More Answers (0)

Categories

Products

Release

R2021b

Asked:

on 23 Mar 2022

Commented:

on 23 Mar 2022

Community Treasure Hunt

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

Start Hunting!