필터 지우기
필터 지우기

Typing an equation in matlab with greek letters

조회 수: 25 (최근 30일)
Panagiota Chatzi
Panagiota Chatzi 2019년 5월 20일
편집: Walter Roberson 2023년 12월 11일
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
gonzalo Mier
gonzalo Mier 2019년 5월 20일
As far as I know you cannot use special symbols in matlab. You have to write them as pi and eta
dpb
dpb 2019년 5월 21일
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.

댓글을 달려면 로그인하십시오.

채택된 답변

Walter Roberson
Walter Roberson 2019년 5월 21일
편집: Walter Roberson 2019년 5월 21일
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)
  댓글 수: 12
Walter Roberson
Walter Roberson 2023년 1월 13일
You forgot the four var* symbols ;)
Walter Roberson
Walter Roberson 2023년 1월 13일
편집: Walter Roberson 2023년 12월 11일

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Get Started with Symbolic Math Toolbox에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by