{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Val inputenter a number the user can enter a number

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

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 element-byelement-byelement 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 (Element-by-element) operations (Element-by- Multiplication does standard matrix multiplication. The columns of a must equal the r...
View Full Document

{[ snackBarMessage ]}

Ask a homework question - tutors are online