I have an 2-D array of data of values at regular elevation and azimuth (or longitude/latitude) points. basically a bunch of r with regular theta and phi.
I would love to plot on a "globe" or an antenna pattern, geoshow requires equal number of latitude and longitude points? and running sph2cart constantly gives wrong dimensions.
latitude [181x1] double values (-90 to 90 )
longitude [360x1] double values(0-359)
pattern [360x181] double
>> geoshow(longitude,latitude,pattern)
Warning: Error creating or updating Surface
Error in value of property ZData
Array is wrong shape or size
>> [x y z]=sph2cart(longitude,latitude,pattern)
Error using .*
Matrix dimensions must agree.

 채택된 답변

Walter Roberson
Walter Roberson 2016년 3월 7일

0 개 추천

Try
geoshow(longitude, latitude.', pattern)
and
geoshow(longitude.', latitude, pattern)
When you are creating a surface, the routines can be fussy about needing one vector to be a row vector and the other to be a column vector.
More stable would be
[long_grid, lat_grid] = ndgrid(longitude, lattitude);
geoshow(long_grid, lat_grid, pattern)

댓글 수: 1

david novotny
david novotny 2016년 3월 8일
Walter, thanks the ngrid worked. I do have a truncation issue to latitude to 0-90 where the data is -90 to 90 and longitude of 0-180 where the data is 0 to 360. both at originally at 1 deg steps
but I am on the right track thanks!!!!!!!

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

Community Treasure Hunt

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

Start Hunting!

Translated by