How do you plot arrows in the streamline function ?

18 visualizzazioni (ultimi 30 giorni)
Arthur Melo
Arthur Melo il 26 Ott 2014
Risposto: Chad Greene il 29 Ott 2014
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 Commenti
Arthur Melo
Arthur Melo il 26 Ott 2014
Please, read again the question, I improved it.
Star Strider
Star Strider il 26 Ott 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.

Accedi per commentare.

Risposte (1)

Chad Greene
Chad Greene il 29 Ott 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?

Categorie

Scopri di più su Vector Fields in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by