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

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!