Useful operators and commands for this unit…
+
, -
, .^
, ( )
, :
, whos
, openvar
The following are really the most basic “exercises” to get everyone started on doing simple maths on the command line. Nothing particularly exciting here, apart from the last couple of exercises that are a bit more maths-y (but not particularly Matlab-heavy).
In the command prompt, try to work out the following:
sqrt()
function?!)And look at the following exercises briefly to make some vectors / list of numbers.
a
containing the number 10
a
with whos
and openvar
b
containing 1 2 3
b
to be a row vector containing 1 2 3
:
) can be used to fill in numbers. Look at help colon
1:10
and 1:2:10
and 10:-1:1
b
c=2:2:12
and try to add the wrongly shaped [1 2]
to c
. Note down the error message!a
and b
. Now the vectors b
and c
. Should this work?Simple commands for getting the mean, std, etc.