How do I scatter twice on the same graph?

11 views (last 30 days)
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 Comments
Walter Roberson
Walter Roberson on 17 Aug 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 on 17 Aug 2024
Yes, that was the so simple problem that I did not see. thank you very much

Sign in to comment.

Answers (1)

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

Community Treasure Hunt

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

Start Hunting!