split a matrix into two matrices according to some rule
古いコメントを表示
How can I generate two separate matrices, one containing the coordinates of line A and the other of line B?
load matrix
figure
plot3(matrix(:,1),matrix(:,2),matrix(:,3),'k.','Markersize',5);
axis equal
grid off

I wanted to try this way but it does not seem the best way.
% range
xRange = [xmin xmax];
yRange = [ymin ymax];
zRange = [zmin zmax];
% indices of points in the range
idx = matrix(:,1) >= xRange(1) & matrix(:,1) <= xRange(2) & ...
matrix(:,2) >= yRange(1) & matrix(:,2) <= yRange(2) & ...
matrix(:,3) >= zRange(1) & matrix(:,3) <= zRange(2);
select_matrix = [matrix(idx,1), matrix(idx,2), matrix(idx,3)];
5 件のコメント
Stephen23
2024 年 2 月 12 日
Do you have the Image Processing Toolbox installed?
Alberto Acri
2024 年 2 月 12 日
Stephen23
2024 年 2 月 12 日
"split a matrix into two matrices according to some rule"
What is the "rule" used to split them up?
Alberto Acri
2024 年 2 月 12 日
Alberto Acri
2024 年 2 月 12 日
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Matrix Indexing についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!


