Matlab + no references: arrays are values + building arrays -- use $[$, $]$! + row versus column vector; rectangular 2-D arrays + scalars, e.g. 1 + start:end, start:step:end + horizontal concatenation, e.g. [ 1 2 3 ] + vertical concatentation, e.g. [ 1; 2; 3 ] + zeros, ones, rand + strings or $char$ arrays + full(sparse(i,j,s,m,n)) + arrays operations and functions operate on entire arrays: ', +, -, .*, ./, .^ length, size abs, sqrt, sum, prod, min, max, rem, round, floor, ceil + logical arrays + 1 for true, 0 for false + relational operations: <, <=, >=, >, ==, ~= + boolean operations: ~, &, | + can be used for indexing + can be used for counting + indexing a(positionsWeCareAbout), a(rowsWeCareAbout,columnsWeCareAbout): + for fetching elements + for assignment to elements + $:$ means "all of them" + duplicate positions are allowed; any order is allowed + can use logical arrays for indexing + assignment + indexing allows assignment to many elements + assigning an empty array deletes elements, e.g. x(1) = [] + assigning a scalar copies the scalar to each element + conditionals and loops: if, for, while + functions: + remember to include a specification comment + one function per file with same name as function + assign to the return *variable(s)* the return value(s) + syntax: function "return-variables" = "function-name" ("parameters") bonus topics: + graphics/plotting in Matlab from May 2 lecture + files in Matlab