how to solve equation in syms

조회 수: 1 (최근 30일)
bencsl
bencsl 2019년 4월 7일
편집: bencsl 2019년 4월 7일
i know the question is kinda stupid but very much appreciated if somebody could helps
syms x;
cos(10+x-x)
the ans keep showing "cos(10)" but i want it to be solved like -0.839071529076452

채택된 답변

madhan ravi
madhan ravi 2019년 4월 7일
syms x pi
cos(pi+x-x)
  댓글 수: 3
madhan ravi
madhan ravi 2019년 4월 7일
편집: madhan ravi 2019년 4월 7일
syms x pi
vpa(cos(10+x-x)) % will match the result in your edited question which was after the answer was given
double(cos(10+pi-pi)) % use double() to convert the result into decimal which of type double because syms result in the class of type sym
bencsl
bencsl 2019년 4월 7일
편집: bencsl 2019년 4월 7일
thx a lot, it cost me 2 hours hahaaa

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Symbolic Math Toolbox에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by