How do I scatter twice on the same graph?

11 vues (au cours des 30 derniers jours)
Roee Ben Shlomo
Roee Ben Shlomo le 29 Avr 2018
Commenté : Guilherme de Melo le 17 Août 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 commentaires
Walter Roberson
Walter Roberson le 17 Août 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 le 17 Août 2024
Yes, that was the so simple problem that I did not see. thank you very much

Connectez-vous pour commenter.

Réponses (1)

Roee Ben Shlomo
Roee Ben Shlomo le 3 Mai 2018
Thank you very much. looking back it was a foolish mistake of mine.

Catégories

En savoir plus sur Scatter Plots dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by