Download presentation
Presentation is loading. Please wait.
1
Introduction to MATLAB
ENGR 1181 MATLAB 2 - Activity
2
Naming Variables in MATLAB
What is wrong with the following variable names? 1Name My Name My-Name
3
Naming Variables in MATLAB
What is wrong with the following variable names? 1Name Answer: starts with numeral My Name Answer: no spaces allowed My-Name Answer: no special characters allowed Rules for naming variables in MATLAB: 1. Variable names cannot exceed 63 characters 2. Names must begin with a letter 3. May contain letters, digits, and the underscore character 4. No spaces are allowed 5. MATLAB is case sensitive, it distinguishes between uppercase and lowercase letters 6. Avoid naming variables with currently defined MATLAB functions Ex: exp, sin, cos, sqrt, length, mean, max, min etc.
4
Questions: How does the semicolon at the end of a statement affect what is displayed? Is MATLAB case sensitive when it comes to variable names? What’s the difference between typing statements in the Command Window versus the Editor Window?
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.