How do i use greek symbols?

I need to put this ecuation in my live script ρ=1015. If i use the insert ecuation option it doesn`t run it,and i can t use latex by itself. How do i create the ρ variable ?

3 Comments

Can't you just live with rho?
Can`t you use your time better than posting an useless comment? I needed the symbol for specific reasons,and not everyone is an expert in MatLab.
I'm ever so sorry for making you that upset. I will continue to walk dangerously close to that level once again though: One of the first "rules" of programming i learnt was KISS - which can be expanded to "never ever make things more complicated than necessary". In this situation transcribing ρ as rho has been sufficient for every situation I've been in where both I and the intended audience would've preffered ρ. If your audience is so pernickety that they cannot accept that I certainly do not envy you.

Sign in to comment.

 Accepted Answer

Steven Lord
Steven Lord on 16 Mar 2022
Variable names must satisfy certain rules in MATLAB. "A valid variable name starts with a letter, followed by letters, digits, or underscores. MATLAB® is case sensitive, so A and a are not the same variable. The maximum length of a variable name is the value that the namelengthmax command returns."
ρ fails the first of those rules, that the variable name starts with a letter. As @Bjorn Gustavsson suggested, use rho or perhaps p as your variable name.

More Answers (0)

Categories

Products

Release

R2022a

Community Treasure Hunt

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

Start Hunting!