필터 지우기
필터 지우기

How to integrate a matrix of a certain dimension?!

조회 수: 1 (최근 30일)
Shashank
Shashank 2012년 12월 19일
Suppose I have a temperature matrix, T = zeros(Nz+1,Nt+1). Nz are number of elements in the z-axis and Nt are number of elements in the time-axis.
What command should I use for calculating the following integral?
E = integral of [A*T(z,:)*exp(-B*z)] with limits z = 0 to L.
Here, the temperature inside the integral is a function of the position z at a certain time.
Any kind of help will be appreciated. Thanks.
  댓글 수: 6
Shashank
Shashank 2012년 12월 19일
Walter, could you help with the syntax for trapz() in my case?!
Nt = 100; Nz = 100;
dz = 1/100;
z = 0:dz:Lz;
TSi = zeros(Nz+1,Nt+1);
Y(i) = (TSi(1:end,i).^4)*exp(-A*z);
% A is a constant, "i" is the ith timestep
T_integral(i) = trapz(z,Y(i));
I am having trouble with dimension mismatch. Could you please tell me how to define Y such that it integrates over ith column of TSi only?!
Shashank
Shashank 2012년 12월 19일
Or is there a way to convert the temperature data points into a polynomial so that calculation becomes easy? Maybe use a curve-fit?

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

답변 (1개)

Muruganandham Subramanian
Muruganandham Subramanian 2012년 12월 19일
편집: Muruganandham Subramanian 2012년 12월 19일
  댓글 수: 1
Shashank
Shashank 2012년 12월 19일
Thanks for your answer. But that does not help somehow.

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

카테고리

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