Interpolating data with specifc / non-consistent "X" values:
1 view (last 30 days)
Show older comments
Hey,
I've got a question that I can't seem to find within MATLAB functions. Right now, I'm trying to get an approximation for sun "yaw" data for a controller I'm trying to design. Right now, I have data at days (beginning from Jul. 15, and day 189 being Jan. 20. )
[1 95 189 277 365]
(If curious, I decided to start experiment after summer solstice happened, and there was only 1 day of sunshine I was free in the Dec. and Jan. months. So, that's why there's not an even split.)
Anyway, using an online suncalc checker, I was able to get yaw angles at each hour on these 5 days, which was nice. However, I'm running into a problem.
My plan initially was to find the polynomial fit for each hour. For instance, at 12:00 on each above day, I have yaw angles:
[56 73 84 66 56]
Now, using Excel, I get the plot in the picture.
My question is how do I generate this plot in MATLAB?
Thanks for any help in advance.
0 Comments
Accepted Answer
Dishant Arora
on 20 Feb 2014
you can realize the polynomial using polyfit function:
P = polyfit(X, Y, n) % n is the order of the polynomial you want
0 Comments
More Answers (2)
See Also
Categories
Find more on Title in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!