Unformatted text preview: er:'); The user can enter a number or an array in brackets If you need to get a string then val = input(`Enter a string:', `s'); Scalar Operations
The following operations are defined between two scalars: Addition Subtraction Multiplication Division Exponentiation a+b ab a*b a/b a^b 3 Scalar / Array Operations
The same operations may be performed between an array and a scalar. In this case the operation is performed to every element of the array. Array vs. Matrix operations
When two arrays are being operated on MATLAB makes a distinction between array an matrix operations. Matrix operations are the standard Linear Algebra operations Array operations are done on an elementbyelementbyelement basis Array vs. Matrix operations
Array or Matrix operations (no difference)
Addition Subtraction Multiplication Right Division Left Division Exponentiation a+b ab a .* b a ./ b a .\ b .\ a .^ b Array vs. Matrix operations
Matrix operations
Multiplication Right Division Left Division a*b a/b b\a Array (Elementbyelement) operations (Elementby Multiplication does standard matrix multiplication. The columns of a must equal the r...
View
Full Document
 Spring '07
 JeffRingenberg
 matlab, Multiplication, Ring, Nested function, Array Operations

Click to edit the document details