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

3 次查看(过去 30 天)
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