how do i continuously calculate an output with an increasing input of angles ?

조회 수: 2 (최근 30일)
i am trying to caluculate 'W' at angles between 0-60 degrees. im not sure how to create a loop function that will allow me to continuously calculate this output whilst varing the angle. I tried using 'theta = 0:60' but that caused an error. my code so far:
theta=(0:60);
w_s = 10; % angular velocity of spin
a_s = 6; % angualar acceleration of spin
w_n = 3; % angular velocity of nutation
a_n = 2; % augalar acceleration of nutation
w_p = 5; % angular velocity of precession
a_p = 4; % angular acceleration of precession
%% Geometry values
rA = [0 7.4103 7.1651];
%% vectors
vw_s = [0 w_s*sind(theta) w_s*cosd(theta)];% spin vector
vw_p = [0 0 w_p]; % precession vector
vw_n = [-w_n 0 0]; % nutation vector
%% Angualar velocity
wi = [-w_n 0 0]; % i component of W
wj = [0 w_s*sind(theta) 0]; % j component W
wk = [ 0 0 (w_p + w_s*cosd(theta))]; % k component of W
W = wi + wj + wk; % Angular Velocity;

채택된 답변

darova
darova 2021년 7월 29일
You need to make wi vector the same size as wj and wk
wi = [-w_n+theta*0 0 0]; % i component of W
  댓글 수: 3
darova
darova 2021년 8월 1일
I don't understand the question. If wi, wj and wk are vecors then W is also a vector

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기

태그

제품


릴리스

R2020b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by