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 Center および File ExchangeNumerical Integration and Differentiation についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by