how to convert struct to sym

39 ビュー (過去 30 日間)
sunitha
sunitha 2021 年 1 月 21 日
編集済み: Walter Roberson 2021 年 1 月 28 日
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 Center および File ExchangeNumbers and Precision についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by