필터 지우기
필터 지우기

Numerical integration of array

조회 수: 1 (최근 30일)
Rita
Rita 2013년 5월 6일
Hej, I am using Matlab in order to integrate a lengthy integral:
Int=4*(P_mean*P_mean')*(PHI(:,1)*PHI(:,1)').*C.*(sqrt(Su(i,:)'*Su(i,:))./(meanwind(i,:)'*meanwind(i,:)));
where P_mean is an nx1 vector PHI(:,1)is an nx1 vector Su(i,:)is an nx1 vector meanwind(i,:)is an nx1 vector So, Int is an nxn array. I want to compute the double integral of the array. Can you please advise me on the use of the trapezoidal rule in this case?Is that my only option?
Thank you for your help,
Best regards,
Rita
  댓글 수: 2
Roger Stafford
Roger Stafford 2013년 5월 6일
Don't you mean Su(i,:) and meanwind(i,:) are 1xn vectors? Three other important questions: a) Is C a scalar or an n x n array, b) are all elements of Su of like sign, and c) do you mean to have "*" or ".*" as the operator between (P_mean*P_mean') and (PHI(:,1)*PHI(:,1)')?
Roger Stafford
Roger Stafford 2013년 5월 6일
The reason for my question about C is that if C is merely a scalar, I believe your integrand is "separable" and its integral can be expressed as the product of two single integrals, each using 'trapz'. If C is an n x n array, then it would probably be necessary to use a 'trapz' call within another one to evaluate the double integral. It would be convenient to know which is true before giving you specific advice.

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

답변 (0개)

카테고리

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