curve fitting area calculation?

1 view (last 30 days)
Davide Cerra
Davide Cerra on 10 Dec 2018
how can i calculate the 2 separate areas of the graph?
a= xlsread('Rosborg BEM.xlsx.','Sheet1','A2:A366');
figure
%%allyear
subplot(2,1,1);
plot(a);
title('System Loads');
xlabel('Time[Days]');
ylabel('[kWh]');
xlim([0,365]);
grid on;
%%fitting
[xData, yData] = prepareCurveData( [], a );
ft = fittype( 'poly8' );
[fitresult, gof] = fit( xData, yData, ft, 'Normalize', 'on' );
subplot(2,1,2);
plot( fitresult, xData, yData );
xlim([0,365]);
legend off
gof
Untitled.png

Answers (0)

Community Treasure Hunt

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

Start Hunting!