MATLAB: Using greek letters as variables and as subscript in Matlab

greek lettersMATLAB

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))

Best Answer

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.
Related Question