3D coordinates vectors. Sum along one of the dimentions of resulting volume

2 ビュー (過去 30 日間)
Alex Kurek
Alex Kurek 2017 年 7 月 4 日
回答済み: John D'Errico 2017 年 7 月 4 日
Hello,
I have a 3D data in a form of 3 vectors: X, Y, Z. I want to sum the resulting volume along on of the dimentions. What is the fastest and easies way to do this?
These are long vectors (20k elements etc.), so it would be better to do this without creating temporary 3D matrix.
In other words: I have 3 vectors with coordinates of points. I would like to create a sum like on the image below - project the 3D volume to one of the walls:
Best regards, Alex
  2 件のコメント
John D'Errico
John D'Errico 2017 年 7 月 4 日
What does this question mean? You have 3 vectors, thus just lists of points?
What does that have to do with meshgrid?
What do you want when you say "sum the resulting volume along on of the dimentions." I'm sorry, but that statement has no meaning.
EXPLAIN your problem CLEARLY. Give a small example. Pictures are a good thing. If you have some data, then attach it as a .mat file, using the paper clip button.
Alex Kurek
Alex Kurek 2017 年 7 月 4 日
Im sorry, I have updated the question

サインインしてコメントする。

採用された回答

John D'Errico
John D'Errico 2017 年 7 月 4 日
I don't have your data, so I cannot use it. But it is simple enough to generate some simple non-uniform data.
xyz = sin(rand(10000,3)*2);
n = size(xyz,1);
H1 = plot3(xyz(:,1),xyz(:,2),xyz(:,3),'b.');
set(H1,'Markersize',.1)
hold on
box on
grid on
H2 = plot3(xyz(:,1),xyz(:,2),repmat(min(xyz(:,3)),n,1),'r.');
set(H2,'Markersize',.1)
The red dots all lie in the projection plane.
If you have vastly more data than this, then you might use smaller dots. But I'll admit that MATLAB graphics seem to lag a bit when trying to plot millions of points. With millions of points, you might also want to use tools like accumarray, to actually count the number of points that lie in any cell of the projection plane.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeSurface and Mesh Plots についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by