필터 지우기
필터 지우기

How to Double integrate cell of array containing cell of array?

조회 수: 3 (최근 30일)
Richard Johnson
Richard Johnson 2023년 5월 3일
편집: Torsten 2023년 5월 3일
Hello,
I have been trying to double integrate a cell of array containing cell of array/objects. However i am not able to get the required result and convert the result inot a matrix of same order (nxn). The screenshot of the same has been attached for reference.
Info regarding the Variables used in code as you in the screenshot attached:-
W{i,j} = 25 x 25 cell, where each cell contains the functions of variable "theta and phi".
Objective is to double integrate the W cell with respect to theta and phi within the limits of zero to pi/2 & zero to 2*pi respectively.
then, followed by converting the result into a matrix of 25x25 order, post compltion of the integration.
Request if someone may please show some guidance for the afpre mentioned problem.
Thanks in advance
Regards
Richard

답변 (1개)

Torsten
Torsten 2023년 5월 3일
편집: Torsten 2023년 5월 3일
Works. If your problem is more complicated, you will have to include the code as plain text (no graphics) in order to see where you get problems.
W = cell(2,2);
W{1,1} = @(theta,phi) sin(theta);
W{1,2} = W{1,1};
W{2,1} = W{1,1};
W{2,2} = W{1,1};
Wnum(1,1) = integral2(W{1,1},0,pi/2,0,2*pi)
Wnum = 6.2832

카테고리

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