How can I to plot wind vectors from a netcdf file?

2 次查看(过去 30 天)
Hi everyone!
I am trying to plot wind vectors from netcdf file with quiver.m function, but then
??? Error using ==> quiver at 77 Matrices X and Y must be the same size as Z.
when I enter
quiver(x,y,mat1,mat2);
in
varname1='uwnd';
[lat,lon,time,mat1,var1,unit1]=read_WWNC_var(filename,varname1);
varname2='vwnd';
[lat2,lon2,time2,mat2,var2,unit2]=read_WWNC_var(filename,varname2);
[x,y] = meshgrid(lon,lat);
how cai I to plot it?,
please help!!
  3 个评论
LUCK RH
LUCK RH 2016-11-7
You are right!! Sizes are diferent: lat= [241 1] lon= [380 1] mat1= [380 241 97] mat2= [380 241 97]
Have you got some sugestion for me?

请先登录,再进行评论。

采纳的回答

Walter Roberson
Walter Roberson 2016-11-5
2 Dimensional arrays read from netCDF files often come out transposed compared to what you would expect. Try
quiver(x, y, mat1.', mat2.')
  2 个评论
LUCK RH
LUCK RH 2016-11-7
Thank you Walter, but now I have a new error message:
if true
"Error using ==> transpose
Transpose on ND array is not defined."
end
How can I to solve it?
Danielle Lemire
Danielle Lemire 2021-5-28
LUCK RH did you ever get an answer to your above problem? I have the same issue.

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Weather and Atmospheric Science 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by