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

11 vues (au cours des 30 derniers jours)
Agnese Foglietti
Agnese Foglietti le 29 Mar 2019
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!

Réponses (1)

Kevin Phung
Kevin Phung le 29 Mar 2019
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?

Catégories

En savoir plus sur Get Started with Curve Fitting Toolbox dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by