Help with the integral function

조회 수: 11 (최근 30일)
Hannah Evans
Hannah Evans 2021년 2월 18일
댓글: Star Strider 2021년 2월 18일
I am trying to use the integral fucntion to solve this problem:
This is my code:
and I keep getting this error:
Error using integral (line 82)
First input argument must be a function
handle.
Any help would be great, Thanks!

답변 (1개)

Star Strider
Star Strider 2021년 2월 18일
It appears that what you want to integrate could be vectors, not functions. If so, use the trapz (or cumtrapz) function to do a trapezoidal integration.
  댓글 수: 2
Hannah Evans
Hannah Evans 2021년 2월 18일
i got this error when using that:
Error using permute
ORDER contains an invalid permutation index.
Error in trapz (line 40)
y = permute(y,perm);
Error in Lab3 (line 103)
Z104(i) = (1./g)*trapz(del104, p_ref104,
p104);
Star Strider
Star Strider 2021년 2월 18일
You will need to supply more than an image of your code if you want help to solve this.
First, my version of MATLAB will not run images of code, only actual code, and second, I need to know what the data are that you’re working with, such as what ‘Sva104’ and the others are.

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

카테고리

Help CenterFile Exchange에서 Numerical Integration and Differentiation에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by