Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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, a,b,c, it will output three unit vectors u1,u2, u3 using the Gram-Schmidt procedure %% orthog - Program to test if a pair of vectors
% is orthogonal. Assumes vectors are in 3D space
clear all; help orthog; % Clear the memory and print header
%%* Initialize the vectors a and b
a = input('Enter the first vector: ');
b = input('Enter the second vector: ');
%%* Evaluate the dot product as sum over products of elements
a_dot_b =0;
for i=1:3
a_dot_b = a_dot_b + a(i)*b(i);
end
%%* Print dot product and state whether vectors are orthogonal
if( a_dot_b ==0)
disp('Vectors are orthogonal');
else
disp('Vectors are NOT orthogonal');
fprintf('Dot product =%g
',a_dot_b);
end

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Modern Datalog Engines In Databases

Authors: Bas Ketsman ,Paraschos Koutris

1st Edition

1638280428, 978-1638280422

More Books

Students also viewed these Databases questions