フィルターのクリア

How to display result from solve ?

10 ビュー (過去 30 日間)
Ole
Ole 2020 年 2 月 4 日
コメント済み: Ole 2020 年 2 月 4 日
How to display the result form solve ?
x = @(y)(y^2-4); eqn =@(y) x(y)==0; syms y; S = vpasolve(eqn(y),y)
Xr2 = [' R2 = ',num2str(S(2),16)];
disp(Xr2)
Error using num2str (line 53)
Input to num2str must be numeric.

採用された回答

KSSV
KSSV 2020 年 2 月 4 日
iwant = double(S)
  1 件のコメント
Ole
Ole 2020 年 2 月 4 日
char(S(2)) also works

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

その他の回答 (1 件)

fred  ssemwogerere
fred ssemwogerere 2020 年 2 月 4 日
what are you trying to do here?
Xr2 = [' R2 = ',num2str(S(2),16)];
This should do nicely:
Xr2 = [' R2 = ',int2str(S(2))];
disp(Xr2)

カテゴリ

Help Center および File ExchangeCharacters and Strings についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by