Double integral of matrix

Hello all,
I need to take double integral of matrix with respect to dy and dy respectively. Also, my matrix consists of the multiplication of its transpose and own so, I got conj text instead of numerical value. Can you help me?
b1 =
[y - 2, 2 - y, y - 1, 1 - y]
[x - 3, 2 - x, x - 2, 3 - x]
b1'
[conj(y) - 2, conj(x) - 3]
[2 - conj(y), 2 - conj(x)]
[conj(y) - 1, conj(x) - 2]
[1 - conj(y), 3 - conj(x)]
I need to take following integral:
Thank you.

9 Comments

Torsten
Torsten on 25 Jun 2023
Edited: Torsten on 25 Jun 2023
I don't understand your integration since x and y seem to be complex numbers.
How would you define, e.g., integral_{1}^{2} integral_{2}^{3} sin(x*conj(y)) dx dy ?
Mukunda
Mukunda on 28 Apr 2025
Edited: Mukunda on 28 Apr 2025
I faced a similar problem
I wanted to integrate B' * B * k (Was trying to do my FEA assignment)
But instead of B' replace it with transpose(B)
This way you won't get conjugate.
transpose(B)*B*k
I am still trying to double integrate the matrix, I cannot figure how to do it. If I find, I will reply to this message again.
[Edited]
I found how to take double integration of a matrix
b1_func = matlabFunction(b1) %Converts to a function that can be integrated
B1_partial = int(b1_func, x, 2, 3); %First integrates the x from 2 to 3
B1 = int(B1_partial, 1,2 ); %Integrates y from 1 to 2.
%Only one variable (y) is present, so no need to add y in the integral
%parameters.
-Thanks
Mukunda
b1_func = matlabFunction(b1)
It is likely that you instead want something like
b1_func(x,y) = b1;
syms x y
b1 = [y - 2, 2 - y, y - 1, 1 - y
x - 3, 2 - x, x - 2, 3 - x]
b1 = 
b1_func(x,y) = b1
b1_func(x, y) = 
B1_partial = int(b1_func, x, 2, 3)
B1_partial(y) = 
B1 = int(B1_partial, 1,2 )
B1 = 
Can I know how is this different from what I wrote?
Can I know how is this different from what I wrote?
What you wrote ?
I added (wrote) a comment.
You wrote
b1_func = matlabFunction(b1) %Converts to a function that can be integrated
which creates an anonymous function handle representing the exxpression in b1 . You then int() the anonymous function -- which converts the anonymous function back into a symbolic expression again.
I, on the other hand, used
b1_func(x,y) = b1
which creates a symbolic function from b1 with parameters x and y. I then proceed to int() the anonymous function -- saving the step of converting to a function handle.
If you were going to use matlabFunction() then you should have used numeric integration using nested integral() calls and the 'arrayvalued' option. (You cannot use integral2() because integral2() does not work with expressions that return arrays.)
Ah, I see. Thank you!
My Code was incomplete in the above written comment. It worked for me as I added those things in code(but those lines were way above).
Thank you!

Sign in to comment.

Answers (0)

Categories

Find more on Programming in Help Center and File Exchange

Products

Release

R2022b

Asked:

on 25 Jun 2023

Commented:

on 29 Apr 2025

Community Treasure Hunt

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

Start Hunting!