Effacer les filtres
Effacer les filtres

Map Projection and Contour Plot

1 vue (au cours des 30 derniers jours)
Amanda
Amanda le 21 Août 2012
When I plot a map created from MATLAB's Map Projection and overlay it over a contour plot, I get an error. Now it will work if I make my lat, long, and temp into an array, but my data from a input file is in column format like:
lat = 54
45
52;
Please help me in finding a way to plot it as column vectors or change the column vectors into an array without destroying the data.
Here is the code:
clc;
figure;
axesm('MapProjection', 'ortho', 'origin', [25,123])
framem;
load coast;
plotm(lat, long, 'k')
gridm
clear lat long;
lat = [50 45 52 45 46 34 32 56 78];
long = [123 132 123 120 122 119 129 135 132];
temp = [72 73 74 60 61 62 65 78 77];
contourm(lat, long, temp)
Thanks,
Amanda

Réponse acceptée

Walter Roberson
Walter Roberson le 21 Août 2012
See griddata() or the TriScatteredInterp class, to convert your scattered points into a grid of data suitable for contourm()
  1 commentaire
Amanda
Amanda le 28 Août 2012
You are right Walter for pointing me in the right direction. Sorry it took me so long to realize it.

Connectez-vous pour commenter.

Plus de réponses (0)

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by