You are on page 1of 2

Problem 1

This is the function to use to check if it is an integer. To check if it is a scalar use size as we have seen
in recitation last week.
function y = isitint( p )
if ( round( p ) = p )
y = 1;
else
y = 0;
end

Problem 2

x>0&x<0
x < 10 & y < 10
xor( a == 10 , b == 10 ) or a == 10 & b ~= 10 | a ~=10 & b == 10
size(A,1)>1 & size(A,2)>1 A matrix has at least two columns and 2 rows (other wise it is a vector or a scalar)
rem( length(p),2) == 0

Problem 3
q = linspace(2,200)
norm( z )
z = 2*pi:2*pi:100*pi You want to increment by 2 Pi to keep the number even
For the dot product just multiply a row by a column (you have to transpose the second vector)

Problem 4
3:2:37
linspace(5,98)
The evaluation exercises can be done at the command-line. You will have to write the matrices on a piece of
paper. So just make sure you know what comma and semi colin means. Make sure you know how to do matrix
caculations on your own.

Problem 5
v = A(:,2)
w = A(3,:)' A(3,:) exports a row, since a column vector is aked you have to transpose it.
x = A(3,4)

You might also like