How to render a 3D object from 2D matrix?

I have 3D data in 3 matrix columns (1000000x3 for columns x, y, z) and would like to render the object. I've tried plot3 and it works, but as there are many datapoints the result is just a mess (see attachment). I thought about binning the data into bins of size e.g. 100x100x10; each bin would then become a 4D point - x,y,z,# of counts. Could you recommend a function for that? I've looked through hist3 and bar3 but they seem to only 3D visualise 2D data.
Thanks in advance, any help would be greatly appreciated.

2 commentaires

Are your points supposed to represent something? The answer to your question entirely depends on what you're trying to see out of that data.
Certainly, the envelope (the convex hull) or your points doesn't look like much.
Points = readmatrix('data_part');
T = convhulln(Points);
plot3(Points(:, 1), Points(:, 2), Points(:, 3), '.');
hold('on')
trisurf(T, Points(:, 1), Points(:, 2), Points(:, 3), 'FaceColor', 'b', 'FaceAlpha', 0.3);
view([-80 5]);
Zuzana Kvicalova
Zuzana Kvicalova le 28 Déc 2019
The points are supposed to represent equatorial surface of a cell, although I copied only a part of the data (so yes, that would probably look like nonsense even when rendered correctly). As there are many points in the whole datasheet (about million), simply drawing a scatter of them doesn't give any idea of how the cell looks, similarly to what I attached in the question. Not to mention it takes forever :). I thought if I could bin them into larger voxels, the resulting image would be more telling.
I'm away from matlab right now but I'll try your code once I'm back at work.

Connectez-vous pour commenter.

Réponses (0)

Community Treasure Hunt

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

Start Hunting!

Translated by