Interpolating data with specifc / non-consistent "X" values:
조회 수: 5 (최근 30일)
이전 댓글 표시
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
채택된 답변
Dishant Arora
2014년 2월 20일
you can realize the polynomial using polyfit function:
P = polyfit(X, Y, n) % n is the order of the polynomial you want
댓글 수: 0
추가 답변 (2개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Polynomials에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!