Answered step by step
Verified Expert Solution
Question
1 Approved Answer
USING MATLAB: utline function OrthogonalityTest should return an output of 3 if the input vectors a and b are orthogonal. Otherwise, it should return an
USING MATLAB:
utline function OrthogonalityTest should return an output of 3 if the input vectors a and b are orthogonal. Otherwise, it should return an output of 7 ecause 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 r 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 3. Otherwise, c should ve a value of 7 nputs: - a vector with unknown dimensions - a vector with the same dimensions as a utputs C will equal 3 if the inputs are orthogonal, or 7 if they are not orthogonal Function Template function c OrthogonalityTest(a,b) if expression statement else statement end end mple Test rthogonalityTest([1,2], [3,4]) should return 7 rthogonalityTest([1,2],0-4,2]) should return 3 nts: 1. Read through section 8.8, 10.1, 10.2 of the Introduction to Programming in MATLAB document on Blackboard for more information on the dot function, logical operators, and if statements. 2. Further information on if statements can be found at the link: if statements. 3. Further information on relational operators can be found at the link: relational operators. 4. Other useful functions for this problem can be found at the links: abs, dot
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