GEN ENG 205 Lecture Notes - Lecture 3: Random Matrix, Negative Number, Semicolon
Document Summary
It is more efficient to use matrices than to use loops. The operator . can be used to multiply matrices element-by- element. You can double-click entries in command history to re-execute them. End commands with a semicolon to prevent matlab from giving you several lines of feedback (output suppression). When entering entries for a matrix or vector, surround the collection of entries with brackets. Commas and spaces make an entry in the next column. Semicolons make an entry in the next row. To print an entry within matrix m, type. M(a, b) where a and b are that entry"s coordinates within the matrix. % triggers comments. clear empties the workspace. clc clears the command window. To concatenate vectors or matrices, do something like this: a=[1 2] b=[3 4 5] c=[a b] The result will be that c=[1 2 3 4 5]. For instance, 1:2:12 -> [1 3 5 7 9 11] To count backwards, simply increment by a negative number.