필터 지우기
필터 지우기

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 CenterFile Exchange에서 Characters and Strings에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by