How do I fit my data to a cos^2?

11 次查看(过去 30 天)
Hi, I have collected this data of angle and Intensity to show that Malus law works
theta = [90, 110, 130, 135, 150, 170, 180, 190, 210, 225, 230, 250, 270, 290, 310,315,330, 350, 365, 370, 390]
I= [0.0030, 0.6240, 1.3060, 1.3320, 0.9610, 0.1900, 0.0160, 0.1970, 1.1250, 1.3480, 1.2900, 0.5660, 0.0030, 0.5750, 1.6170, 1.6760, 1.0850, 0.1380, 0.0940, 0.2250, 1.2340]
I tried a few ways but when it comes to plotting I obtain very strange stuff like lines far from the points and I think I just didn't understand how you do this. Thank you very much in advance for your help!

回答(1 个)

Kevin Phung
Kevin Phung 2019-3-29
All I used was the plot function and I got something pretty sinusoidal
theta = [90, 110, 130, 135, 150, 170, 180, 190, 210, 225, 230, 250, 270, 290, 310,315,330, 350, 365, 370, 390]
I= [0.0030, 0.6240, 1.3060, 1.3320, 0.9610, 0.1900, 0.0160, 0.1970, 1.1250, 1.3480, 1.2900, 0.5660, 0.0030, 0.5750,...
1.6170, 1.6760, 1.0850, 0.1380, 0.0940, 0.2250, 1.2340]
figure
plot(theta,I)
does this not work for you?

类别

Help CenterFile Exchange 中查找有关 Get Started with Curve Fitting Toolbox 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by