Unable to use a value of type function_handle as an index.

조회 수: 44 (최근 30일)
Waseem Akhtar
Waseem Akhtar 2021년 2월 18일
댓글: Waseem Akhtar 2021년 2월 18일
hi all,
I am trying to perform double integration using following syntax:
Gxh=@(xpp,zpp) (xpp+zpp)
GXH=integral2(Gxh,aa,bb,cc,dd);
but i am getting following error message:
"Unable to use a value of type function_handle as an index."
I have already tried to change the names of Gxh and GXH but to no avail. Please help me resolve the issue!
  댓글 수: 2
Just Manuel
Just Manuel 2021년 2월 18일
When I assign some integers for aa, bb, cc and dd, your code works for me.
What is your full error message? What are aa, bb, cc and dd in your code?
Waseem Akhtar
Waseem Akhtar 2021년 2월 18일
full error message is: Unable to use a value of type function_handle as an index.
The values of limits aa,bb,cc and dd are not integers, rather these +ve/-ve decimal values.
Also the expression (xpp+zpp) is simplified here, actual expresssion in my code is very long

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

채택된 답변

Walter Roberson
Walter Roberson 2021년 2월 18일
You have accidentally assigned a value to a variable named integral2

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Logical에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by