Unable to convert 'sym' value to 'double'. after using solve

1 回表示 (過去 30 日間)
Christian Fokdal
Christian Fokdal 2018 年 10 月 10 日
コメント済み: Christian Fokdal 2018 年 10 月 11 日
syms DELTA_2 DELTA_CR tcr;
assume(2>tcr>0); tcr=sqrt((4*H)/(OMEGA*Pm))*(DELTA_CR - DELTA_0);
if M==Z fprintf('%.4f %.4f %.4f %.4f %.4f %.4f %.4f %.4f \n' ,T, DELTA_0deg, OMEGA, DELTA_1deg, solxdeg, DELTA_3deg, solydeg, tcr) end
-----
Error using fprintf
Unable to convert 'sym' value to 'double'.
---
error for tcr

回答 (1 件)

gonzalo Mier
gonzalo Mier 2018 年 10 月 10 日
I have not much info with this... but, I guess tcr = constant * (DELTA_CR - constant). That means tcr doesn't have a double value because it depends on DELTA_CR. Try to print tcr before fprintf, and if is not that, give more info please
  1 件のコメント
Christian Fokdal
Christian Fokdal 2018 年 10 月 11 日
https://se.mathworks.com/matlabcentral/answers/423228-error-using-fprintf-unable-to-convert-sym-value-to-double-error-in-sym-double-line-665-xstr
nobody seemd to anwser the long post so I made a shorter one. The one above has the entire code.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeNumbers and Precision についてさらに検索

製品


リリース

R2017b

Community Treasure Hunt

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

Start Hunting!

Translated by