Exercises 1.8 Homework
1.
Suppose that A is a matrix. Describe, in words, the following objects:
A(3, :)A(:, end-2)A(1:2, end-1:end)A(1:2:end, 1)A(:, end:-1:1)
2.
Write a script to do the following:
x = (first 5 digits of your SUID); y = (all entries of x except first); z = (all entries of x except last); u = (the sum of vectors y and z); v = (the scalar product of vectors y and z, also known as the dot product in Calculus);
Then display u and v using disp.
Note that y and z must be computed from the vector x, not entered number-by-number.
3.
Write a script that does the following:
- Let
Abe some 3 by 3 matrix filled with numbers 1,2,…,9 - Let
xbe the product ofAand a row vector with all entries equal to 1 (think about the correct order of multiplication). - Let
ybe the product ofAand a column vector with all entries equal to 1.
When uploading your script to Blackboard, leave a comment with answers to the following questions:
- What is the meaning of the entries of
x? In other words, what information aboutAdo we get from the entries ofx? - What is the meaning of the entries of
y?
Hint
Both x and y represent certain sums.