How can I get the interpolated value of and array
显示 更早的评论
I have 2 arrays, one with distances and one with heigth.
heigth = [10 20 30 40]
distance = [1 2 3 4]
I want to be able to get the heigth at any given value from 1 to 4. The main idea is to be able to do:
getHeigth(1.5) --> 15
采纳的回答
更多回答(2 个)
Michael Haderlein
2015-5-13
>> doc interp1
Purushottama Rao
2015-5-13
0 个投票
c= fit([1; 2; 3 ;4],[10 ;20; 30; 40],'poly2')
1 个评论
Purushottama Rao
2015-5-13
Later u can call c(1.5) results in 15
类别
在 帮助中心 和 File Exchange 中查找有关 Interpolation 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!