Question: Write a function ProjectionPlot that plots the vectors a = OA, b = OB, and c = OC, where c is the projection of a

Write a function ProjectionPlot that plots the vectors a = OA, b = OB, and c = OC, where c is the projection of a onto b

For your problem, A = (6,3), B = (3,6). All plots must be in the same figure in the order indicated in the function template. The projection vector cshould be plotted in the colour black, with a line thickness of 1. The vectors a and b do not require any customisation to line colour, thickness, etc.

The vector c may be calculated using MATLAB or by hand.

The function template is provided below.

function ProjectionPlot()

c = 0;

hold on

%insert plot of OA

%insert plot of OB

%insert plot of OC

hold off axis('equal')

end

This is what I have so far:

function c = ProjectionVector(a,b)

x = [0,2.4]; y = [0,4.8]; hold on c=(dot(a,b)./(norm(b)^2)).*b;

plotv(a); plotv(b); plotv(c,'k','LineWidth',1); hold off axis('equal') end

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!