interpolating longitudes from latitude
3 ビュー (過去 30 日間)
古いコメントを表示
I have a bunch of lattitudes and longitudes that make up a specific shape with some latitudes and longitudes being repeated.
I need to find a way to interpolate what latitudes would be at a given lattitude point from 40.5-43.5 every .1 interval. My actual data is much more specific with few lattitude points actually at simple numbers and most looking like this: 43.2930.
Is it possible to get this information from my dataset of 536x2 lat and long?
I have tried sorting my data: sorteddata=sortrows(data,[1,2]);
to be able to use: newlon=intrplon(sorteddata(:,1), sorteddata(:,2), 40.5)
but it won't go through I assume since I have multiples of both lat and long.
It keeps giving me this error: Error using intrplon (line 61)
LATITUDE must be monotonic.
Any advice would be great, thank you.
0 件のコメント
回答 (1 件)
Sujay C Sharma
2020 年 6 月 17 日
Hi,
The polyfit and polyval functions may be able to help you out in this regard. Here is an example of how you can use it for interpolation:
X = [1:10];
Y = [1:10];
c = polyfit(X,Y,1);
Input = [10:0.1:11];
Output = polyval(c,Input);
disp(Output);
Your latitudes and longitudes from your dataset can be used in place of X and Y and your Input would be [40.5:0.1:43.5] in your case. Do take a look at the documentation of polyfit and polyval for more examples
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Structures についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!