Typing an equation in matlab with greek letters

7 vues (au cours des 30 derniers jours)
Panagiota Chatzi
Panagiota Chatzi le 20 Mai 2019
Hello,
I have a problem with the greek letters in the line below. How can i insert the greek letters and also multiply them with each other the same time?
rs=(kB*T)/(4*π*η*D0);
Thank you!
  2 commentaires
gonzalo Mier
gonzalo Mier le 20 Mai 2019
As far as I know you cannot use special symbols in matlab. You have to write them as pi and eta
dpb
dpb le 21 Mai 2019
Indeed, not allowable, not just what you know... :)
variable-names has the rules.
It doesn't seem as though there really is any direct reason the character set couldn't be extended, but never seems to occur. Of course, there are potential issues with internationalization and not all character sets are the same, but doesn't seem insurmountable.

Connectez-vous pour commenter.

Réponse acceptée

Walter Roberson
Walter Roberson le 21 Mai 2019
Modifié(e) : Walter Roberson le 21 Mai 2019
syms kB T D0
Pi = evalin(symengine, '`π`');
nu = evalin(symengine, '`η`');
rs=(kB*T)/(4*Pi*nu*D0);
rs =
(T*kB)/(4*D0*`η`*`π`)
... Just don't ask to symvar(rs)
  14 commentaires
Mohammad Qaza
Mohammad Qaza le 8 Sep 2024
any idea how I can write two consecutive greek letters like Delta theta without having theta as subscript?
Walter Roberson
Walter Roberson le 8 Sep 2024
That is a good question. I cannot think of any way to do it.

Connectez-vous pour commenter.

Plus de réponses (0)

Community Treasure Hunt

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

Start Hunting!

Translated by