



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!




Week 3 Lecture notes: 9/9/
MATLAB Predefined Functions and Programming (Engineering Analysis and MATLAB7 - Chapters 6 and 8 )
Goals:
Notes:
Predefined MATLAB Functions From Chapter 6 (5 minutes)
Programming in MATLAB
o MATLAB allows the user to control how data is input into programs and how output is displayed o input command allows the programmer to request input syntax for input of a scalar (Activity #2)
o Selection Structures - allows programmer to execute one or more commands based on a certain criteria being true or false. The program selects a “path” to continue on based on a logical condition. They often contain Relational or Logical operators
Relational operators (Table 4 p 223)
Functions Executed one after another
MATLAB Can execute different commands that may take the program on different paths based on logical conditions.
Activity #5 Examples of the use of operators
What if you are comparing 2 matrixes? Every element is compared, and if the condition is not satisfied for every comparison, MATLAB sees the result as false find - unique command to MATLAB. Best to use the find command rather than use relational or logical operators (see p224- 228 for more details)
o If, else, elseif (p229-233) Considered CONDTIONAL STATEMENTS Work much better with scalars rather than matrices
-------- (Matlab commands) if (conditional statement)
-------- (Matlab commands) end