Borrar filtros
Borrar filtros

3D Plot with large data

12 visualizaciones (últimos 30 días)
stephen
stephen el 15 de Feb. de 2011
Respondida: changiz el 27 de Mayo de 2014
Hi, I have a question regarding doing a 3D plot.
I have a 500,000x3 matrix (column A, B, C). Now I want to do a 3D plot by showing A in x-axis and B in y-axis and C in z-axis. I know I could probably use funtion "mesh" to do the plot. But to use the mesh function, I have to use meshgrid function to transform the vectors into matrices. The problem is that since each variable has 500,000 rows, I got an error message "Maximum variable size allowed by the program is exceeded." Anyone has a solution to it or other ways of doing the 3D plot?
Thanks for your help!
Stephen
  2 comentarios
Oleg Komarov
Oleg Komarov el 15 de Feb. de 2011
Don't recall the post, but you won't need all of the points especially since the amount of pixels on the screen are less...
changiz
changiz el 27 de Mayo de 2014
u can use isosurface ,if you matrix name is mat: isosurface(mat);

Iniciar sesión para comentar.

Respuestas (3)

Jiro Doke
Jiro Doke el 15 de Feb. de 2011
Another thing you could try is to do some interpolation of the data and plot at a lower resolution. As Oleg points out, there's no sense in trying to visualize 500000 points at once. Check out triscatteredinterpclass (or griddata).
F = TriScatteredInterp(M(:,1), M(:,2), M(:,3));
[qx, qy] = meshgrid(linspace(min(M(:,1)), max(M(:,1)), 20), ...
linspace(min(M(:,2)), max(M(:,2)), 20));
qz = F(qx, qy);
mesh(qx, qy, qz);
  1 comentario
Walter Roberson
Walter Roberson el 15 de Feb. de 2011
Or gridfit,
http://www.mathworks.com/matlabcentral/fileexchange/8998

Iniciar sesión para comentar.


Walter Roberson
Walter Roberson el 15 de Feb. de 2011
You have not really defined what you want your plot to look like or whether the points are expected to have relationships to adjacent points.
plot3(M(:,1), M(:,2), M(:,3))
scatter3(M(:,1), M(:,2), M(:,3))
  2 comentarios
stephen
stephen el 15 de Feb. de 2011
Thanks for your quick response, Walter.
Each pair of A and B decides an unique value of C. The plot would like a curved surface. I tried plot3 but looks like the screen froze for a little while then crashed. I guess it was because the data is too big.
Walter Roberson
Walter Roberson el 15 de Feb. de 2011
Sounds like you don't have any structuring of the points. In that case, scatter3() would be better. You could start off with a random sampling of points to see how it goes:
numsamps = 1000;
idx = 1 + floor(size(M,2) * rand(numsamps,1));
scatter3(M(idx,1), M(idx,2), M(idx,3));

Iniciar sesión para comentar.


changiz
changiz el 27 de Mayo de 2014
u can use isosurface ,if you matrix name is mat: isosurface(mat);

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by