필터 지우기
필터 지우기

How do you plot arrows in the streamline function ?

조회 수: 26 (최근 30일)
Arthur Melo
Arthur Melo 2014년 10월 26일
답변: Chad Greene 2014년 10월 29일
I want get arrows in this streamlines, but I can't use the streamSLICE function because I have only 2d variables, e.g.: only U and V, X and Y. What I have to do ?
I've tried all the possibilities, could you helpe me ? The variables are in the attach file!!
*>> streamline(lon,lat,uwnd,vwnd, startx,starty);*
Error using griddedInterpolant Interpolation requires at least two sample points in each dimension.
Error in interp1 (line 183) F = griddedInterpolant(X,V,method);
Error in stream2 (line 62) sxi=interp1(xx(:),1:szu(2),sx(k));
Error in streamline (line 62) verts = stream2(x,y,u,v,sx,sy,options);
*>> streamslice(lon, lat, uwnd,vwnd, startx,starty,'arrowsmode')*
Error using streamslice (line 137) U,V,W must all be a 3D arrays.
*>> streamslice(lon, lat, uwnd,vwnd,'arrowsmode')*
Error using griddedInterpolant Interpolation requires at least two sample points in each dimension.
Error in interp1 (line 183) F = griddedInterpolant(X,V,method);
Error in stream2 (line 62) sxi=interp1(xx(:),1:szu(2),sx(k));
Error in streamslice>nicestreams (line 297) vertsf = stream2(x,y, u, v,xstart,ystart,streamoptions);
Error in streamslice (line 133) [vertsout, avertsout] = nicestreams(x,y,u,v,density,arrows);
  댓글 수: 3
Arthur Melo
Arthur Melo 2014년 10월 26일
Please, read again the question, I improved it.
Star Strider
Star Strider 2014년 10월 26일
The variables.mat file will help. If it does not contain ‘stream2.m’, it would also help if you uploaded and attached your ‘stream2.m’ file. It will tell us what you are doing and will put the errors into context.

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

답변 (1개)

Chad Greene
Chad Greene 2014년 10월 29일
If the problem is that streamslice wants data in 3D and you only have 2D data, why not make up some fake z data?
z = ones(size(lon));
w = zeros(size(z);
Or, a couple of submissions on FEX might be close to what you're looking for. StreakArrow and Curvvec, for example?

카테고리

Help CenterFile Exchange에서 Vector Fields에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by