I was trying to solve this problem but it is showing error like??? "Attempt to reference field of non-structure array.."i am not able to find the erro ..please help

1 次查看(过去 30 天)
w = 4.7;
E0=6.9;
l=8;
h=4;
P1=1*10^10;
d0=0.4;
m1=15.6;
m2=2.65;
E1=8.85*10^-21;
d=1:10:40;
A0=l.*h;
c=E1./d.^2;
B1=(d./d0).^(1/3);
E2=E0.*(1./B1);
V=d.*E2;
U0=0.5.*E1.*E2.^2.*(d0./d)^(2/3);
A1=A0.*U0./P1;
U1=(U0.*d.A0)./((d+h).*(A0+A1));
M1=m1.*h.*A1.*10^-24;
M2=m2.*(d+h).*A0.*10^-24;
U2=(U1./(M1+M2))*10^27;
x1=E2.*E1;
X2=E1.*E2./(d+h);
C1=c.*d./((d+h).*(1+A0/A1));
R=d./x1.*A1;
C=c.*d.*A1;
T=R.*C;
P=U2./T;
plot(d,U2)
"Attempt to reference field of non-structure array.."

采纳的回答

Walter Roberson
Walter Roberson 2014-2-12
Look at your line
U1=(U0.*d.A0)./((d+h).*(A0+A1));
you missed * between the d. and the A0
U1=(U0.*d.*A0)./((d+h).*(A0+A1));

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Cell Arrays 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by