From the start Flashcards
what is a scalar?
a single number
what is a vector?
a collection of 2 or more numbers in a row or column
what is another name for a vector?
array
How do I acces vectors?
Using an index e.g: y(3)
accessing third entry in vector y
y(1:3)?
index is a vector, accessing entries 1-3 in vector y
how do we create a row vector?
scalars in vector are separated by spaces when defined
e.g. [1 2 3 4 5]
how do we create a column vector ?
scalars in vector are separated by semicolons when created
e.g. [1;2;3;4;5]
how many types of vectors are there?
2 (row and column)
how do I convert between row and column vectors?
using a ‘tick’ ‘
e.g. z’
How do I create equally spaced vectors?
by defining start value: step size: end value
How do I create equally spaced vectors?
by defining start value: step size: end value
e.g. x=0: 2: 10
what is the requirement for vector-vector maths?
both vectors must have same length
what is a script?
scripts are a collection of matlab commands stored in a.m file
how do you execute a script?
simply type the name of the script in the command window and press ‘enter’
How do I edit a script?
type ‘edit scriptname.m’ (‘scriptname is the name of my script”)