How do you plot arrows in the streamline function ?
34 views (last 30 days)
Show older comments
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 Comments
Star Strider
on 26 Oct 2014
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.
Answers (1)
Chad Greene
on 29 Oct 2014
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?
0 Comments
See Also
Categories
Find more on Vector Fields in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!