scatter3 not working

7 visualizzazioni (ultimi 30 giorni)
Magdalena Malenda
Magdalena Malenda il 6 Dic 2016
Risposto: Steven Lord il 8 Dic 2016
Function scatter3 seems to not working in my matlab. Also when I run examples from references page ex. for Create3DScatterPlotExxample.m only empty coordinates system is displayed and I get no error message. I use MATLAB R2016b.
This is the example code:
figure
[X,Y,Z] = sphere(16);
x = [0.5*X(:); 0.75*X(:); X(:)];
y = [0.5*Y(:); 0.75*Y(:); Y(:)];
z = [0.5*Z(:); 0.75*Z(:); Z(:)];
scatter3(x,y,z)
  1 Commento
David Barry
David Barry il 6 Dic 2016
Please upload some example code and tell us what error you are getting.

Accedi per commentare.

Risposte (2)

Star Strider
Star Strider il 6 Dic 2016
The example works for me in R2016b as posted in the example.
The first possibility is to consider a path problem. See if running these two lines from your Command Window or your script solves it:
restoredefaultpath
rehash toolboxcache

Steven Lord
Steven Lord il 8 Dic 2016
Modify your last line to call scatter3 with an output argument.
h = scatter3(x, y, z)
Show what that displays. If that command does not throw an error, also show what these commands display.
ax = ancestor(h, 'axes')
f = ancestor(h, 'figure')
f.Visible
f.Position
f.Units
Those commands will show us information about the axes and figure in which the scatter plot should have been created. The last three commands will tell us if the figure is hidden or has been created off-screen.

Tag

Community Treasure Hunt

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

Start Hunting!

Translated by