How to get results from symbolic variable integration
조회 수: 2 (최근 30일)
이전 댓글 표시
Pretty straight forward, I'm trying to do integration with symbolic variables.
I'm doing some complex integration with a mix of high degree polynomials and trig functions.
This is what I tried so far:
syms x
b4 = (x^127+x^32-x^12+78*x^2-5*cos(x))
int(b4, 0, 1)
I was hoping to get some number for the answer, but instead, I got this:
ans =
int((x^127+x^32-x^12+78*x^2-5*cos(x)), x, 0, 1)
I don't know why this is happening. How do I get the actual answer in numbers?
댓글 수: 0
채택된 답변
Walter Roberson
2016년 7월 27일
There is no readily-found closed-form solution for your actual integral. You will need to use vpa() or double() to request numeric integration.
댓글 수: 2
추가 답변 (1개)
Andrei Bobrov
2016년 7월 27일
in R2016a
>> syms x
b4 = (x^127+x^32-x^12+78*x^2-5*cos(x));
int(b4, 0, 1)
ans =
1425581/54912 - 5*sin(1)
>>
댓글 수: 1
참고 항목
카테고리
Help Center 및 File Exchange에서 Assumptions에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!