how do i add output of Fx and Fxd?

2 次查看(过去 30 天)
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.

请先登录,再进行评论。

Community Treasure Hunt

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

Start Hunting!

Translated by