Problem in solving integration inside the for loop

조회 수: 2 (최근 30일)
GAYTRI ARYA
GAYTRI ARYA 2021년 7월 17일
답변: Torsten 2021년 7월 18일
for i=1:6
for j=1:6
f1=@(phi1)(cos(phi1)*i)+2*j;
F=integral(@(phi1)f1,0,1);
end
end
This is the small model of programme which I want to run. This code works if I remove @(phi1) symbol from the integral command, which is possible only for 1-D. But this need to be done for four variable, so I want to make it run in this scenario. Please suggest for solving four variable integral with an additinal 2-D array (i,j-mentioned here) or how to remove @ issue.
  댓글 수: 10
GAYTRI ARYA
GAYTRI ARYA 2021년 7월 18일
@Torsten Really thankful to you. The symbolic Math toolbox is amazing, I tested it for small expression but for 4_D integration and two array functions and it gives result almost immediately.
GAYTRI ARYA
GAYTRI ARYA 2021년 7월 18일
@Scott MacKenzie Thankyou for the attention in resolving the issue as early as possible.

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

채택된 답변

Torsten
Torsten 2021년 7월 18일
Possible approaches to answer the question can be read in the discussion above.

추가 답변 (0개)

카테고리

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