How to display result from solve ?

9 Ansichten (letzte 30 Tage)
Ole
Ole am 4 Feb. 2020
Kommentiert: Ole am 4 Feb. 2020
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.

Akzeptierte Antwort

KSSV
KSSV am 4 Feb. 2020
iwant = double(S)

Weitere Antworten (1)

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

Kategorien

Mehr zu Mathematics finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by