|
采用cell可以解决每次解数目不同的问题! 但还没解决cell2mat的问题!:@L
f=load('1.txt');j=size(f,1); TolSh=cell(j,1);
for i=1:j
c1=f(i,1);c2=f(i,2);c3=f(i,3);o=f(i,4);Vp=f(i,5);Vs=f(i,6);p=f(i,7);
Km=0.5*(c1*36.6+c2*76+c3*6.85+(c1/36.6+c2/76+c3/6.85)^(-1));
Um=0.5*(c1*45+c2*26+c3*20.9+(c1/45+c2/26+c3/20.9)^(-1));
a=sqrt(Um/(Km+4/3*Um)); G=0.9552+0.0448*exp(-c3/0.06714); m=1;
n=10^(0.426-0.235*log10(p))/m; syms Sh;
y=Vp*(G*a*(1-o)^n+sqrt(3.3*Sh/(((1-Sh)/2.29+Sh/7.9)^(-1)+4/3*3.3*Sh))*o*Sh)-Vs;
Sh=solve(y,Sh); TolSh{i}=subs(Sh)';
end
TolSh %% TolSh=cell2mat(TolSh) |
|