필터 지우기
필터 지우기

How to integrate for a data set ?

조회 수: 3 (최근 30일)
Manish Kumar
Manish Kumar 2019년 3월 7일
댓글: A K M Kamrul Hasan 2020년 8월 29일
Dear All,
I want to integrate the following equation
Screenshot (35).png
I have the data set of P(hw) and hw. I want to input the value E_g. Data set is given in the excel sheet

답변 (1개)

Star Strider
Star Strider 2019년 3월 7일
I have no idea what you are doing.
Try this:
filename = 'solar_spectrum.xlsx';
[D,S,R] = xlsread(filename);
Phw = D(:,1);
hw = D(:,2);
E_g = hw >= 0.5; % Logical Index — Choose ‘E_g’ (Here: 0.5)
S = trapz(hw(E_g), Phw(E_g))
figure
plot(hw, Phw)
hold on
patch([hw(E_g) fliplr(hw(E_g))], [Phw(E_g) fliplr(Phw(E_g))], 'y')
hold off
grid
producing:
S =
2.0305
The plot shows the approximate area covered by the integration.
Experiment to get the result you want.
  댓글 수: 1
A K M Kamrul Hasan
A K M Kamrul Hasan 2020년 8월 29일
How about integration of p^2(hw)d(hw)?

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

카테고리

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