Interpolating data with specifc / non-consistent "X" values:
5 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Chris
el 20 de Feb. de 2014
Respondida: Chris
el 20 de Feb. de 2014
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 comentarios
Respuesta aceptada
Dishant Arora
el 20 de Feb. de 2014
you can realize the polynomial using polyfit function:
P = polyfit(X, Y, n) % n is the order of the polynomial you want
0 comentarios
Más respuestas (2)
Ver también
Categorías
Más información sobre Polynomials en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!