Hello Everyone;
I have encountered an issue regarding, I think, the command "syms ". When I wrote the code below in the image, it did not display the numerical value completely, rather it displayed as an incomplete result. How can i solve this problem? How can i get fully calculated answer?
Screen Shot 2019-01-25 at 22.41.26.png

 채택된 답변

Star Strider
Star Strider 2019년 1월 25일

0 개 추천

It is not incomplete. The Symbolic Math Toolbox assumes that you want a symbolic result unless you tell it otherwise.
Try this:
syms f(x) x
f(x) = cos(x) - 2*x + 3;
f1 = f(1)
vpa_f1 = vpa(f1)
producing:
f1 =
cos(1) + 1
vpa_f1 =
1.540302305868139717400936607443
Also, while ‘a picture may be worth a thousand words’, here on MATLAB Answers, actual posted code (copied from your Editor or Command Window and pasted here) is worth a thousand pictures of it!

댓글 수: 2

Gökhan Gök
Gökhan Gök 2019년 1월 25일
편집: Gökhan Gök 2019년 1월 25일
Thank you for your answer Star Strider. I would edit the question regarding your point, but no need anymore. Since your answer solved the issue. Next time, I consider it :)
Star Strider
Star Strider 2019년 1월 25일
As always, my pleasure.

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

추가 답변 (0개)

카테고리

제품

릴리스

R2015b

질문:

2019년 1월 25일

댓글:

2019년 1월 25일

Community Treasure Hunt

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

Start Hunting!

Translated by