%use fitobject = fit([x,y],z,fitType)creates a surface fit to the data in vectors x, y, and z.
fitobject = fit([t,omega_0],z,fitType);
fittype('A*cos(omega_0*t+phi)','problem',{'A','phi'},'options',fo) %fo was previously defined & a and b are coefficients and n is a problem-dependent parameters
%__________________________________________________________________________
%phi is defined below by the angular function:
xdft = fft(t); % Obtain the DFT
camp = 2/length(t)*xdft(t); %this is FFT at any point t
angle(camp) % gives the phase at a certain point, but how to do it at the
%represents as a function in all places, I have no idea
abs(camp) % amplitude i.d.F A=abs(camp)
%__________________________________________________________________________
% problem = Problem-dependent (fixed) parameter names, i.e. a &
% phi is the zero phase angle at the time t=0
% options = Fit options, specified as the comma-separated pair consisting of 'options' and the name of a fitoptions object.
% Example: 'coefficients',{'a1','a2'}
Goal: - run this code -get value for coefficient A & phi (which is the phase shift)
I defined all variables & imported the data table as column vectors (401x1 matrices each). Im solely working in the x-y-plane, so z=0 in all rows. Alternatively I could fit the surface with Anonymous Functions, but I think strongly that that won't solve/ improve the real problem of running the code.
tis not defined, among other things.