MATLAB serves as an interpretive environment. In other words, you provide a command and MATLAB executes it instantly. You can refer to the examples below to gain a better understanding of MATLAB and its syntax.
Practical Examples
Input a valid expression, like the examples below: - Example 1: 5 + 5 Press ENTER. When you click Execute or press Ctrl + E, MATLAB will immediately execute the command and return the result as: ans = 10
Operators and Special Characters Used in MATLAB
MATLAB supports the following operators and special characters:
Special Variables and Constants in MATLAB
MATLAB supports the following special variables and constants:
Naming Variables
Variable names consist of letters followed by any combination of letters, digits, or underscores.
Note: MATLAB is case sensitive.
Variable names can be long or short, but MATLAB only uses the first N characters, where N is determined by the nailengthmax function.
Save Changes
The Save command is used to store all working variables as a file with the extension .mat in the current directory.
For example:
save myfile
You can reload the file anytime using the load command:
load myfile
This article by Mytour just introduced you to MATLAB, basic syntax in MATLAB. Readers can explore more about articles revolving around the MATLAB topic like how to create a Script using Matlab to enhance their understanding of using this program. Best of luck to all of you!
