Question: Modify this Octave script so that given any three linearly independent input vectors, a , b , c , it will output three unit vectors
Modify this Octave script so that given any three linearly independent input vectors, abc it will output three unit vectors uu u using the GramSchmidt procedure orthog Program to test if a pair of vectors
is orthogonal. Assumes vectors are in D space
clear all; help orthog; Clear the memory and print header
Initialize the vectors a and b
a inputEnter the first vector: ;
b inputEnter the second vector: ;
Evaluate the dot product as sum over products of elements
adotb ;
for i:
adotb adotb aibi;
end
Print dot product and state whether vectors are orthogonal
if adotb
dispVectors are orthogonal';
else
dispVectors are NOT orthogonal';
fprintfDot product g
adotb;
end
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
