Filter data for quiver

1 view (last 30 days)
ocean motion
ocean motion on 20 Apr 2013
I can't find an elegant way to plot every fourth value from my 201x301 matrix by quiver function. I have tried to make the undesired points zero but it leaves the dots, plus the cycle was quite long.
So how can I refer to particular values from the matrix???

Answers (2)

the cyclist
the cyclist on 20 Apr 2013
Try making the undesired points NaN rather than zero.

the cyclist
the cyclist on 20 Apr 2013
If M is your matrix, then you could try plotting
>> M2 = M(1:4:end,1:4:end);
to get every fourth point in each dimension.
  2 Comments
ocean motion
ocean motion on 20 Apr 2013
Thank you, but NaN I've tried myself and it didnt help. And about 2nd suggestion...you see..the point is to keep the initial size of the matrix because it's a map. I plot it as quiver(lon,lan,U,V) so if I use U(1:4:end,1:4:end) or something similar it can't plot it because the dimensions don't agree, so important is to keep the whole field but leave only chosen points with values.
the cyclist
the cyclist on 20 Apr 2013
Can't you apply the same concept to each of lon,lan,U,V to get the dimensions to agree?

Sign in to comment.

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!