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

3 views (last 30 days)
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 Comments
Sam Chak
Sam Chak on 6 Aug 2020
Edited: Sam Chak on 6 Aug 2020
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?

Sign in to comment.

Answers (0)

Categories

Find more on Interpolation in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!