m_proj question: unexpected error

4 vues (au cours des 30 derniers jours)
jenka
jenka le 2 Juil 2012
I have vector of lat and lon defined as:
lat = linspace(90,32,30);
lon = linspace(0,358,180);
I then do m_proj:
m_proj('equidistant,'lon',[lon(1) lon(end)],'lat',[lat(1),lat(end)]);
Then:
[x,y]=mll2xy(lon,lat);
This gives me an error of "inputs must have the same size". Any suggestions? I think I used this function before with success. Thank you!

Réponses (3)

Tom
Tom le 2 Juil 2012
The clue's in the name- one is a 1x30 vector, the other's 1x180; you can make them the same size by setting the 3rd argument in linspace the same for both lat and lon.

Walter Roberson
Walter Roberson le 2 Juil 2012
My guess is that you want
[Lat, Lon] = ndgrid(lat, lon);
[x,y] = mll2xy(Lon,Lat);

jenka
jenka le 2 Juil 2012
Hi, well actually that is what is giving to me. I cannot change it. I did [x,y]=m_ll2xy(lon,lat,'clip','off')

Catégories

En savoir plus sur Logical dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by