how do i add output of Fx and Fxd?

조회 수: 2 (최근 30일)
ANIKET KADAM
ANIKET KADAM 2016년 2월 25일
댓글: ANIKET KADAM 2016년 2월 25일
F(row,i)= Fx + Fxd
  댓글 수: 1
ANIKET KADAM
ANIKET KADAM 2016년 2월 25일
clc; clear all;
%%input time=0.2; K=170e6; C=15e-6; x=20e-6; y=20e-6;
%%initialize z = 13; %%z=13 H = 0.005; %%0.005m ld = 0.04; %%0.04m wc = 131; %%w=131rad/s theta = 360/z; tempphi=0; tempsi=0; row = 1; j=1; %counter for increment in defect angle
for t=0:37e-6:time %%time increment si(j)=tempsi; %%initialize defect angle
for i=1:1:z %%ball increment
phi(i)=tempphi; %%ith ball angle
disp('phi = '); phi(i)
if (phi(i) == si(j)) %%condition for ball in defect region
thetat = (wc*t) + (2*3.14/z*(z-i))
Fxd(row,i)= K* (x* cos(phi(i)*(pi/180)) + y* sin(phi(i)*(pi/180)) - (C + H * sin(3.14/(ld*(thetat-phi(i)*(pi/180)))))).^(3/2) * cos(phi(i)*(pi/180));
disp('Fxd value');
disp(Fxd(row,i));
Fyd(row,i)= K* (x* cos(phi(i)*(pi/180)) + y* sin(phi(i)*(pi/180)) - (C + H * sin(3.14/(ld*(thetat-phi(i)*(pi/180)))))).^(3/2) * sin(phi(i)*(pi/180));
disp('Fyd value');
disp(Fyd(row,i));
disp('defect ball position');
else %%condition for ball in non-defect region
Fx(row,i)= K* (x* cos(phi(i)*(pi/180)) + y* sin(phi(i)*(pi/180)) - C).^(3/2) * cos(phi(i)*(pi/180));
disp('Fx value');
disp(Fx(row,i));
Fy(row,i)= K* (x* cos(phi(i)*(pi/180)) + y* sin(phi(i)*(pi/180)) - C).^(3/2) * sin(phi(i)*(pi/180));
disp('Fy value');
disp(Fy(row,i));
disp('other balls position');
end
tempphi = phi(i) + theta;
end
tempphi = 0;
tempsi = si(j) + 45;
if(tempsi >= 360)
tempsi = 0
end
j = j + 1;
row = row + 1;
end

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

답변 (1개)

Jos (10584)
Jos (10584) 2016년 2월 25일
What do these 5 variables in the statement " F(row,i)= Fx + Fxd" hold?
To be added like this, Fx and Fxd should have of the same size. The sum (Fx + Dxd) has that size as well. This should fit in the position in F indicated by row and i. So, F(row,i) should have that size as well. If F does not exist, you might want to omit the indices (row,i)
You can check all this by looking at these individual elements of the statement.
  댓글 수: 1
ANIKET KADAM
ANIKET KADAM 2016년 2월 25일
thankyou for answer. there was an attached file along with question which displayed the variables meaning.

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

카테고리

Help CenterFile Exchange에서 Surfaces, Volumes, and Polygons에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by