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

조회 수: 3 (최근 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에서 Creating and Concatenating Matrices에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by