BMEN 2401 Lecture Notes - Lecture 4: Matrix Multiplication, Keyboard Shortcut, Nxp Semiconductors
Document Summary
Includes: conditional execution methodologies, iterative processing, and matrix operations vs. element-wise operations. Also the example of some of the many ways to enter piece-wise functions into matlab. If statements and their variations: if logicalexpression1. Statements2 end: instead of using elseif can also do separate if statements as long as each one is capped off with end, difference between elseif and else: ??, ex. If statement for squareroot of positive x values. Make sure to indent statements to keep organized and clean when codes get longer. % compute the square root of x for all positive x x=4. ** keyboard shortcut to indent is ctrl + i. Switch expressions: similar formatting to if else statements but these aren"t a direct comparison. If it doesn"t meet the first expression, it is skipped and the next one is analyzed. They must also be a scalar or string.