Effacer les filtres
Effacer les filtres

Periodically fill scatter3

2 vues (au cours des 30 derniers jours)
Sandi Homolak
Sandi Homolak le 11 Nov 2022
Réponse apportée : Karim le 11 Nov 2022
I have a matrix that changes with every iteration of code and want to make a scatter3 plot from it that fills the plot in every itteration. how do I make it do that instead of overwriting the last scatter3 plot?
So the Matrix is 20x3, so in first iteration there needs to be 20 dots, second iteration 20 more so 40 overall and so on.
Also why does my scatter show up only after I stop the code from running? How to display it during code run?

Réponse acceptée

Karim le 11 Nov 2022
you can use the 'hold on' command to preserve the figure and add information to it, see below for an example
% create an empty figure
% enable to plot multiple data
hold on
% start a loop...
for i = 1:5
% create a new dummy matrix
MyMatrix = rand(20,3) * 10;
% plot the points
% stop the data gathering in the figure
hold off
% create a legend
axis equal
grid on

Plus de réponses (0)


En savoir plus sur 2-D and 3-D 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