Question
Due on **/** at the beginning of lab. Submit your m-file and a diary that shows how you tested the code. Use the algorithm for
Due on **/** at the beginning of lab.
Submit your m-file and a diary that shows how you tested the code.
Use the algorithm for Gram-Schmidt that was covered in lab and not the algorithm
that is written in the book.
Write an m-file grams.m
to perform the Gram-Schmidt process on the columns of a matrix A with an arbitrary number of columns (the input) and return a matrix Q whose columns are the resulting vectors. Test your code on the following matrix:
A = 1 -1 7 1
0 6 -3 6
-7 -7 -7 4
-9 6 0 -1
Check that your answer is orthonormal.
Hint:
You can use the following hint to start the assignment.
Pseudo-code:
initialize Q
run through each column of Q
create the sum (hint: use a for loop)
subtract the sum from the column of Q
end
run through each column of Q
normalize the column of Q
end
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started