Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Filter data for quiver

Asked by 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???

0 Comments

ocean motion

Products

No products are associated with this question.

2 Answers

Answer by the cyclist on 20 Apr 2013

Try making the undesired points NaN rather than zero.

0 Comments

the cyclist
Answer by 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 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 on 20 Apr 2013

Can't you apply the same concept to each of lon,lan,U,V to get the dimensions to agree?

the cyclist

Contact us