필터 지우기
필터 지우기

double integration on a matrix in MATLAB.

조회 수: 6 (최근 30일)
Mukesh Reddy Samreddy
Mukesh Reddy Samreddy 2023년 6월 28일
답변: Harshavardhan Putta 2023년 6월 28일
I am working on a project where I need to perform a double integration on a matrix in MATLAB. The matrix represents a set of data, and I want to calculate the cumulative sum of elements along both the row and column dimensions. Any guidance or code examples would be greatly appreciated.
  댓글 수: 1
Image Analyst
Image Analyst 2023년 6월 28일
Do you want to do it symbolically? Or numerically like using sum or cumsum on the matrix? Why not just say
integral2D = sum(yourMatrix, 'all');

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

답변 (1개)

Harshavardhan Putta
Harshavardhan Putta 2023년 6월 28일
Hi,
I understand that you would like to calculate the cumulative sum of elements along both the row and column dimensions. To accomplish this, you can utilize the cumsum function in MATLAB. By applying cumsum twice, first along the rows and then along the columns, you can obtain the desired double integration result.
% Example matrix
A = [1 2 3; 4 5 6; 7 8 9];
% Double integration
integrated = cumsum(cumsum(A, 1), 2);
Please refer to the following documentation for more information.
I hope it helps!
Thanks.

카테고리

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