How do I interpolate usng vectors? and they are large..

1 回表示 (過去 30 日間)
Michael
Michael 2015 年 6 月 9 日
編集済み: Stephen23 2015 年 6 月 9 日
I have a series of data points as vectors:
depth, time, lon, & temperature all of the same size (6882 x 1), which I have obtained from a structure such as struct.time etc.
I now wish to interpolate to get values in between the data points to create a field of values, how would I go about doing this?
I have some idea, such as using repmat, looping, interp3 etc. but I can't seem to get it to work.
As a result, I would like to plot depth vs longitude with values of temperature shown as an interpolated matrix..
Also, I would like to grid the data without interpolation, such to have a depth vs lon with a temperature field.
Any help would be much appreciated!
cheers, Michael
  2 件のコメント
Michael
Michael 2015 年 6 月 9 日
Also, in the past when attempting to do this my computer freezes during repmat as the vectors are too large, so a way of doing it via a loop or using a small amount of memory will be nice. Ideally, I would like a matrix like 6882 x 6882 x 6882 x 6882.
Stephen23
Stephen23 2015 年 6 月 9 日
編集済み: Stephen23 2015 年 6 月 9 日
An array of size 6882 x 6882 x 6882 x 6882 has 6882^4 = 2243151844981776 elements. If you use double data class then each element requires 64 bits which gives 17945214759854208 bytes of data. So the total memory required is about 16 Pebibytes (or 18 Petabytes).
In 2006 the entire Library of Congress collection was estimated at 10 Petabytes, so good luck finding a hard-drive to save that array on. And processing it might be slow too...
Or, for an easier solution, you could rethink your algorithm.

サインインしてコメントする。

採用された回答

Andrei Bobrov
Andrei Bobrov 2015 年 6 月 9 日
編集済み: Andrei Bobrov 2015 年 6 月 9 日
F = scatteredInterpolant([depth,lon],temperature);
use
l1 = linspace(min(depth),max(depth),1000);
l2 = linspace(min(lon),max(lon),1000);
[xq,yq] = meshgrid(l1,l2);
vq = F(xq,yq);
mesh(xq,yq,vq);

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeCreating and Concatenating Matrices についてさらに検索

製品

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by