how to convert struct to sym

55 次查看(过去 30 天)
i am solving non linear equations using excel data . but i am getting the error is unable to convert struct to syms can anyone help me ??
syms N J
Qo=xlsread('suspended.xlsx','A:A')
R=xlsread('suspended.xlsx','B:B')
No=xlsread('suspended.xlsx','C:C')
X=xlsread('suspended.xlsx','D:D')
V=24345;
k=1.076;
Kn=0.27
kd=0.04
bs=0.15
Xf=0.49
Df=1.04
Dw=1.3
L=0.04
a=2.24
Y=0.39;
bt=kd+bs
Nstar=N/Kn;
Nmin=Kn/((Y*k/bt)-1);
Lstar=L*(sqrt(k*Xf/Kn*Df))*Df*Dw;
Nstar_min=(1/(Y*k*(bt-1)));
jstar=(J/sqrt(Kn*k*Xf*Df));
nX = size(X,1 );
solutions = cell(1, nX);
for S=1:nX
solutions{S}=solve(Qo(S)*(1+R(S))*(No(S)-N)-V*(a*J+((X(S)*k*N)/(Kn+N))),(sqrt((Lstar^1.76)+5.2*(Nstar-Nstar_min))-(Lstar^0.88))/2.6==jstar^0.88,N,J)
vpa(solutions{S})
end
celldisp(solutions)

采纳的回答

Walter Roberson
Walter Roberson 2021-1-25
编辑:Walter Roberson 2021-1-28
for S=1:nX
solutions{S}=solve(Qo(S)*(1+R(S))*(No(S)-N)-V*(a*J+((X(S)*k*N)/(Kn+N))),(sqrt((Lstar^1.76)+5.2*(Nstar-Nstar_min))-(Lstar^0.88))/2.6==jstar^0.88,N,J);
temp = struct2cell(solutions{S});
vpa(horzcat(temp{:}))
end
This will use one column for each variable, but in the general case you will have difficulty figuring out exactly what order the variables will appear in -- and this makes no aattempt to label them on output.

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Numbers and Precision 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by