MATLAB Answers

Cannot calculate integral function

조회 수: 6(최근 30일)
lvenG
lvenG 2021년 9월 20일
댓글: Star Strider 2021년 9월 20일
Help on this case. I am integrating a certain function with known upper and lower limits as per below but when I run it, the command window still shows an integral function and not a numerical value. Thanks and hoping for some help.
syms y
V = (2/3).*pi.*3.4.^3 .*(1-exp((-4.*100./300)*((1./y.^4)-(1./y.^2))));
B = int(V, y, 0, 10000);

채택된 답변

Star Strider
Star Strider 2021년 9월 20일
If you want a numeric result, use vpaintegral (introduced in R2016b) instead of int. Not all expressions have analytic integrals.
syms y
V = (2/3).*pi.*3.4.^3 .*(1-exp((-4.*100./300)*((1./y.^4)-(1./y.^2))));
B = vpaintegral(V, y, 0, 10000)
B = 
.
  댓글 수: 2
Star Strider
Star Strider 2021년 9월 20일
As always, my pleasure!
.

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

추가 답변(0개)

Community Treasure Hunt

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

Start Hunting!

Translated by