From the course: MATLAB 2018 Essential Training

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Define variables and constants

Define variables and constants - MATLAB Tutorial

From the course: MATLAB 2018 Essential Training

Start my 1-month free trial

Define variables and constants

- [Instructor] The secret to creating flexible and powerful MATLAB scripts is to use variables effectively. As the name implies variables store changing values and can serve as the basis for calculations in your scripts or in the command window. In this movie I will work solely in the command window typing commands to illustrate how to use variables in MATLAB. Variables are named entities within MATLAB that let you store the result of a calculation or of a value that might change. Variable names must start with a letter and they are case sensitive. So for example if I were to type in VAR one equals three and enter then I would see VAR one equals three. If I were to display the value of VAR one I could try VAR one and enter, and I would get number three. However if I type capital VAR one and enter then it's undefined because I have not assigned a value to capital VAR one. You also see that the program has asked did you mean VAR one with a lower case V? And it offers that text for you…

Contents