1

I've just started using MATLAB and one of my assignments requires me to use Greek letters (in particular, α). I tried copying it into the code area, and also tried using the \alpha command, none of which seem to work.

I get the error message: "| Error: Unexpected MATLAB operator."

Could anyone tell me how I can get it to work or perhaps if there's another way to type Greek letters?

Thanks!

ShinyPebble
  • 135
  • 1
  • 1
  • 10
  • 2
    why not just type `alpha` as the var name? – asiviero Sep 01 '15 at 20:14
  • You may be confusing this with Mathematica. Though Mathematica can accept symbols as variables, MATLAB cannot. Please see the duplicate question for more clarification. – rayryeng Sep 01 '15 at 20:52

1 Answers1

0

You cannot use the greek letter α as a variable name. For that you should simply type it as alpha. If you want, however, you can use it in a plot and other UI elements.

For example you might want to set the title of the plot to something such as:

title('Intensity (\alpha = .2)')
Mr Tree
  • 431
  • 1
  • 4
  • 12