How to calculate normal values of each xyz co-ordinates and ouput as a column vector for each co-ordinate?

9 ビュー (過去 30 日間)
Hi,
I have xyz point cloud data as a 40000x3 with each row containing a single point with x y and z data in the columns.
I am trying to calculate the normal value for each point to the origin, this works for an individual row, for example:
normd = norm(data(1,:));
However I need to do it for all the rows, i used this code but it combines it into all one normal value.
normd = norm(data(1:40000,:));
Ideally I need the normal value of each row (coordinate), in a column vector, for the range from 1 to 40000.
Thanks for any help.
Joe

採用された回答

Matt J
Matt J 2018 年 2 月 23 日
編集済み: Matt J 2018 年 2 月 23 日
normd= sqrt( sum(data.^2,2) );
  3 件のコメント
Matt J
Matt J 2018 年 2 月 23 日
編集済み: Matt J 2018 年 2 月 23 日
Not sure how it works? Isn't it virtually the definition of the norm you are trying to compute?
Joe Pashley
Joe Pashley 2018 年 2 月 27 日
Looked at the code again and followed it step by step and understand it now, thanks.

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangePoint Cloud Processing についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by