Answered step by step
Verified Expert Solution
Question
1 Approved Answer
complete this with MATLAB. Outline The finction OrthogonalityTest should return an output of 1 if the input vectors a and b are orthogonal. Otherwise, it
complete this with MATLAB.
Outline The finction OrthogonalityTest should return an output of 1 if the input vectors a and b are orthogonal. Otherwise, it should return an output of 6 Because of errors associated with floating point arithmetic, we do not want to check orthogonality by checking whether the dot product is equal to zero. Instead, we should check whether the absolute value of the dot product is below a tolerance of 10-10. If it is, the vectors are assumed to be orthogonal and c should have a value of 1. Otherwise, c should have a value of 6 Inputs: a a vector with unknown dimensions b - a vector with the same dimensions as a. Outputs c will equal 1 if the inputs are orthogonal, or 6 if they are not orthogonal Function Template function c = OrthogonalityTest(a,b) if expression statement else statement end end Example Test OrthogonalityTest([1,2], [3,4]) should return 6 OrthogonalityTest([1,2], [-4,2]) should return 1Step 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