How do I fit a sinusoidal curve to data? Trouble with fitit
1 次查看(过去 30 天)
显示 更早的评论
Hello, I am new to Matlab and am working on a final project for school. I would like some assistance with figuring out what to do with a data set. I basically modeled certain fashion trends over time and assigned a certain fashion trend with values ranging from 1 to 5.
Here's my time (x axis) vector: t=1900:5:1995;
Here's my y-data vector: shoulders = [5 4 3 2 2 1 3 4 5 5 4 3 3 1 2 2 5 5 5 3];
I feel like the data oscillates and I would like a sinusoidal function to fit my data points, how do I do this? I tried googling it and found a function called fitit that a user made, but when I tried to run it, it says that my X value didn't match up with my rows. I don't quite fully understand the whole program, so I would like some help in understanding where in the program I change the number of rows it requires to just 1.
Here's the link: http://www.mathworks.com/matlabcentral/fileexchange/31562-data-driven-fitting-with-matlab
Since I only have 20 data points, if that is not enough data points for fitit to work well, what other functions can I use to fit my sinusoidal functions? Sorry, I'm just not super comfortable with curve fitting oscillations and would like as much help as possible :)
0 个评论
另请参阅
类别
在 Help Center 和 File 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!