Question: Write a MATLAB code segment that assumes two variables are set: PT - 1x2 matrix representing an X,Y coordinate D - single real number The
Write a MATLAB code segment that assumes two variables are set: PT - 1x2 matrix representing an X,Y coordinate D - single real number
The code segment should set the variable R to the word 'HIT', 'CLOSE' or 'MISS' depending on the distance from PT to the origin. Set to HIT if the distance is less than or equal to D, CLOSE if the distance is between D and 2*D, or MISS if the distance is greater than or equal to 2*D.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
