필터 지우기
필터 지우기

Using greek letters as variables and as subscript in Matlab

조회 수: 59 (최근 30일)
F.O
F.O 2017년 11월 23일
댓글: Walter Roberson 2017년 11월 23일
I want to write two things :
  • first B and puttings theta as letter not word as subscripts
  • second : using lambda or others as variables in the function or scriptsphip=phix+asind(cosd(lambda)*sin(D)/cosd(lambdap))

채택된 답변

Walter Roberson
Walter Roberson 2017년 11월 23일
Sorry, the only characters that can be used in variable names or function names are:
  • must start with one of A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z
  • after that, each character must be one of A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, or _ (underscore)
  • maximum of 63 characters in the identifier.
You might want to look at Live Script, which allows you to insert equations and formula as comments and which can be displayed as output.
  댓글 수: 2
F.O
F.O 2017년 11월 23일
This is not practical at all as we need those all the time in physics and mathematics
Walter Roberson
Walter Roberson 2017년 11월 23일
If your system locale is set to English then you can include characters up to char(255) in the source code directly, inside character vectors or string objects or comments.
If your locale is set to some other languages (in particular Korean, Chinese, or Japanese, and possibly others) and your MATLAB is new enough, then you can include characters up to char(65535) in the source code directly, inside character vectors or string objects or comments. But test this before you go very far: if you do not see an option in your File menu to save as UTF-8 then your MATLAB might not support this.
If you are using OS-X then there is a preference hack to enable UTF-8 inside character vectors or string objects or comments; I have never tried using that myself.
However, there is no support for using any characters outside of char(32) to char(126) (together with char(9) [tab], char(10) (newline), and char(13) (carriage return)) in MATLAB source code outside of character vectors or string objects or comments .
I have no information as to whether this will ever change.. eventually, perhaps.
I suggest opening a service request and making your use case known; Mathworks prioritizes changes based upon customer demand in service requests.

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Labels and Annotations에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by