How do I scatter twice on the same graph?

3 Ansichten (letzte 30 Tage)
Roee Ben Shlomo
Roee Ben Shlomo am 29 Apr. 2018
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 Kommentare
Walter Roberson
Walter Roberson am 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 am 17 Aug. 2024
Yes, that was the so simple problem that I did not see. thank you very much

Melden Sie sich an, um zu kommentieren.

Antworten (1)

Roee Ben Shlomo
Roee Ben Shlomo am 3 Mai 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!

Translated by