
Text :-
warning off
load("HW6Dataset1.mat")
% Assuming variable names are delta, intensity
% Defining Fit type
myfittype = fittype('A + B*cos(phi+delta)','dependent',{'Intensity'},...
'independent',{'delta'},'coefficients',{'A','B','phi'});
% Fiting Data
[myfit,gof] = fit(delta,intensity,myfittype); % myfit is cfit object which is our model
% gof is a struct containing
% values defining goodness of fit
% like Squared errors,
% rsquare, root mean square error
% For getting value of phi
phi = myfit.phi;
% For getting OPD
lam = 385;
OPD = (lam/(2*pi))*phi;
% Plot using this to confirm if it fits data nearly
plot(myfit,delta,intensity)
% enter 'myfit' without qoutes in command window to get 95% confidence intervals of obtained
% coefficients
warning on
Homework 6-(Week 11, Lab) Submission deadline, 04/14/2019 at 9pm Problem 1: An interferometer is ...