Seeking an efficient method for using 'scatter3' to create a 3D scatter plot of fixed receiver positions.
Ältere Kommentare anzeigen
Hi,
I wish to represent a 3D array of reciever positions as dots - see attached plot for the general idea (I won't share the shameful code used to generate it, haha). My intention is to then animate the plot by representing each position's signal amplitude by its corresponding dot's colour (each sample generates a new plot/frame). I've successfully animated plots of a 2D plane of receiever positions, with amplitude on Z-axis, so I'll cross any issues with that bridge once I've had a good attempt myself, but I welcome any quick tips or relevant docs people may have about sending the time dimension data to the figure's colour info.
My only question at this stage is actually about how to most effieciently plot a 3D "block" of dots (as below) according to specified dimensions - basically - in very broad terms - to input 3 x 3 x 3 and get something resembling the attached image (or any three dimensions for that matter). The solution is almost guaranteed to be embarassingly simple, but it has eluded me so far (I've been ill, so my concentration is totally shot, which hasn't helped).
Many thanks in advance for any advice, tips, links or hints, etc.
Cheers!

Akzeptierte Antwort
Weitere Antworten (1)
Try scatter3:
t = 0:pi/5:4*pi;
xt = sin(t);
yt = cos(t);
h = scatter3(xt,yt,t,40, t*30, 'MarkerFaceColor', 'b');
colormap(hsv(512))
colorbar
box on
grid on
caxis([0 512])
% Animation
for i=1:20
h.CData = rand(size(t)) * 512;
drawnow
pause(0.1);
end
3 Kommentare
Max Heiken
am 13 Jul. 2021
OP already knows about scatter3 as we can infer from the attached image.
Chunru
am 13 Jul. 2021
The OP plot can be produced by plot3 as well :-)
Peter Beringer
am 13 Jul. 2021
Kategorien
Mehr zu Discrete Data Plots finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
