Question: Using MATLAB, how do you plot vectors and the resultant force? It starts with an importanted excel sheet. First column in excel is the magnitude,
Using MATLAB, how do you plot vectors and the resultant force?
It starts with an importanted excel sheet. First column in excel is the magnitude, second column is the direction.
Need to use a "FOR Loop"
This is what I have so far:
data = xlsread('Project2.xlsx');
[r,c] = size(data);
for i = 1:r arrayx(i) = data(i,1)*cosd(data(i,2)); arrayy(i) = data(i,1)*sind(data(i,2)); end
x = sum(arrayx); y = sum(arrayy);
rmag = sqrt(x^2 + y^2); rdir = atan(y/x);
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
