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

1 visualizzazione (ultimi 30 giorni)
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 Commenti
Michael
Michael il 9 Giu 2015
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 il 9 Giu 2015
Modificato: Stephen23 il 9 Giu 2015
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.

Accedi per commentare.

Risposta accettata

Andrei Bobrov
Andrei Bobrov il 9 Giu 2015
Modificato: Andrei Bobrov il 9 Giu 2015
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);

Più risposte (0)

Categorie

Scopri di più su Creating and Concatenating Matrices in Help Center e File Exchange

Prodotti

Community Treasure Hunt

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

Start Hunting!

Translated by