フィルターのクリア

How can i calculate the center of mass ?

15 ビュー (過去 30 日間)
omar almasri
omar almasri 2019 年 11 月 28 日
コメント済み: Rik 2019 年 11 月 29 日
Hello every one
i want to calculate the center of mass for 3 Matrix.I have a file of CAD then i have to transfer it to Matlab file by STL File. In Matlab i get 3 Matrix , one for X axi, one for Y and one for Z. How can i calculate the center of mass ?
  3 件のコメント
omar almasri
omar almasri 2019 年 11 月 28 日
I dont know .
i also dont know how to handel with Matrix
Rik
Rik 2019 年 11 月 29 日
What is the code you currently have and how did you try to implement my answer?

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

回答 (1 件)

Rik
Rik 2019 年 11 月 28 日
You can use the VOXELISE function to convert your mesh to a voxelgrid. Use a resolution that makes the most sense to you: too few will decrease your accuracy, too many will cause memory issues. I would suggest picking z-values that do not occur in your mesh, but that is optional.
Then you will have a 3D logical array. You can use findND to get the coordinates of all your voxels: [x,y,z]=findND(L);
The last step is to find the mean values of x,y,z.

カテゴリ

Help Center および File Exchange2-D and 3-D Plots についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by