Skip to Main Content Skip to Search
Product Documentation

Creating Variables

How to Create Variables

You create variables by doing the following:

You can also load user-defined variables from Storage.

New variables you create in the Variable Editor can be viewed in the Data Editor by using the right-click menu in any view to select Current View > Variable List. Alternatively, select the menu item View > Split View > Variable List to add this new view to the currently selected plot.

You can edit existing variables

New Variables

You can define new variables in terms of existing variables:

You can type directly in the edit box or add variable names by double-clicking them. In the case of variable names especially, this latter method avoids typing mistakes. Variable names are case sensitive.

The preceding example shows a definition for a new variable called POWER that is defined as the product of two existing variables, tq and n, by entering POWER = tq x n.

Note that the Variable Editor looks different depending on whether you opened it to create a new variable or edit an existing one. The example above shows the editor when adding a new variable. If you open the editor to edit a variable there is an additional list on the left. You can choose which of your existing variables to edit from this list, or click the button to add a new item to the list if you want to add a new variable.

  


Recommended Products

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.

 © 1984-2012- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS