- #1
Feodalherren
- 605
- 6
Homework Statement
So I have a function that allows me to input two vectors and it will calculate the resultant vector. The code works fine.
I need to call on this function and plot the two input vectors and the resultant; it's easier to explain if you look at the code.
Homework Equations
The Attempt at a Solution
-------CODE-------
run ResVecfigure
grid off
%Data from ResVec
x1 = [ 0 v1_x ];
y1 = [ 0 v1_y ];
x2 = [ 0 v2_x ];
y2 = [ 0 v2_y ];
x3 = [ 0 vR_x ];
y3 = [ 0 vR_y ];
hold on
plot(x1,y1,x2,y2,x3,y3)
------------END--------------
But MATLAB first of all doesn't pull out v1_x, v1_y etc. out of the function. I want it to pull the values out of the function ResVec and store them in the workspace. Second of all, it seems to be refusing to plot these vectors and keeps plotting just one of them.