How do I scatter twice on the same graph?

6 visualizaciones (últimos 30 días)
Roee Ben Shlomo
Roee Ben Shlomo el 29 de Abr. de 2018
Comentada: Guilherme de Melo el 17 de Ag. de 2024
Hello,
I have 2 vectors with numbers: velocity(815x1) and velocityTimes(815x1). Velocity is calculated, among the other parameters, with a variable N which also changes the way it looks when scattered.
I need to scatter velocity and velocityTimes once, change N, and then on the same graph scatter it again with the new N.
However I can't seem to get it right.
What I'm trying to do is this:
n = 2
figure(1)
scatter(velocityTimes,velocity)
hold on
n = 150
scatter(velocityTimes,velocity)
But it only scatters the first one, with n=2. How do I fix it?
Thanks very much in advance!
  7 comentarios
Walter Roberson
Walter Roberson el 17 de Ag. de 2024
The number of elements in x and y must match the number of elements in sz (with some exceptions for the case of matrix x and y and vector sz.)
If back_azm_ev2_error matches the size of time_vector_ev2 for the first call, then it is not going to match the size of time_vector_ev1 for the second call, but you used back_azm_ev2_error as the sz for both calls.
Guilherme de Melo
Guilherme de Melo el 17 de Ag. de 2024
Yes, that was the so simple problem that I did not see. thank you very much

Iniciar sesión para comentar.

Respuestas (1)

Roee Ben Shlomo
Roee Ben Shlomo el 3 de Mayo de 2018
Thank you very much. looking back it was a foolish mistake of mine.

Categorías

Más información sobre Scatter Plots en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by