how i can export the curve fitting to my actual curve?

조회 수: 2 (최근 30일)
Ana Soph
Ana Soph 2020년 8월 5일
댓글: Ana Soph 2020년 8월 6일
Hi guys, thank you so much for reading me, i am using matlab 2019a, the problem that i have, is i want to graph the curve that is provided for the curve fitting tool to my current curve. So.. what can i do? i was trying to plot the function that is given for the curve fitting tool but it doesn't work.
this is my code right now, ,and also i show you the curve fitting that i want, again thank you so much
pd: the data that i have is in datetime...
tEnersol=readtable('solar.xlsx','sheet','EneDics'); % read into a table object
tEnersol.Properties.VariableNames={'Rad','Dia'}; % assign variable names
yr=2014; % need the proper year
tEnersol.Date=datetime(yr,1,tEnersol.Dia); % and create a date column
hB=plot(tEnersol.Date,tEnersol.Rad, '.r'); hold on % plot against actual date
xtick(0:50:350);
hAx=gca; % get axes handle...
xlim([datetime(2014,1,1) datetime(2014,12,12)]) % set limit to cover the full year
hAx.XAxis.TickLabelFormat='MM'; % show day of MONTH
% xticklabels(cellstr(tEnersol.Date(xticks))) % use the date string as tick labels
hAx.XTickLabelRotation=45; % rotate so can have chance to read...
xlabel('Mes del año, TMYE'), ylabel('Irradiancia solar máxima [KWh/m^2]');
% a1= 2329
% b1= 0.6522
% c1= 0.95
% a2= 1519
% b2= 0.7781
% c2= -2.545
% d =(1:50:365);
% w = a1.*sin(b1.*d+c1) + a2.*sin(b2.*d+c2)
% D = datetime(yr, 1, d);
% plot(D, w, '.-b')
  댓글 수: 2
Sam Chak
Sam Chak 2020년 8월 6일
편집: Sam Chak 2020년 8월 6일
I think the issue has something to do with the checked 'Center and scale' option. The coefficients for the normalized x. Try unchecking it. I don't know why the Sum of Sine is selected. isn't the skew gaussian distribution a better fit?
Ana Soph
Ana Soph 2020년 8월 6일
thank you, you are right!

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

답변 (0개)

카테고리

Help CenterFile Exchange에서 Interpolation에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by