Singular Value Decomposition of a Large XYZ file

4 ビュー (過去 30 日間)
Oguzhan M
Oguzhan M 2018 年 8 月 14 日
コメント済み: Oguzhan M 2018 年 8 月 21 日
Hi everyone, I need to perform Singular Value Decomposition on a XYZ file (surface scan file with 3 columns and millions of row) to simplify the surface. In the papers I have checked in the literature, they present a 2D picture (x-z base) colouring with amplitude (y-height), and state that the fluctuating surface elevation of the surface y(x,z) should be decomposed. Any idea how to turn very narrow randomly lined xyz values into a matrix that we can implement SVD? Cheers.

採用された回答

Christine Tobler
Christine Tobler 2018 年 8 月 14 日
First thing that occurs to me would be to interpolate the xyz data to lie on a rectangular grid in the x-z plane, and to then apply SVD to the resulting matrix (millions of rows should translate to a number of rows and columns in the thousands?).
Here is a doc example for how to interpolate xyz-data on a grid.
  1 件のコメント
Oguzhan M
Oguzhan M 2018 年 8 月 16 日
Thanks for the prompt response. When I interpolate xyz data, I get 3 matrices as expected. Should I apply SVD to x and z matrices separately to reduce number of points, if yes, how can I re-combine new x and z matrices with y matrix (unchanged) to achieve the complete simplified surface? Thanks, Oguzhan.

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

その他の回答 (1 件)

Christine Tobler
Christine Tobler 2018 年 8 月 16 日
The way I thought of it was to use x and z as the 2d grid on which to interpolate, and y as the function value. Something like this:
x = randn(10, 1); y = randn(10, 1); z = randn(10, 1);
[xi,zi] = meshgrid(linspace(-1, 1), linspace(-1, 1));
yi = griddata(x,z,y,xi,zi); % yi is a matrix with the values of y interpolated on the grid (xi, zi)
In this case, you would do SVD of the yi data, I think?
  1 件のコメント
Oguzhan M
Oguzhan M 2018 年 8 月 21 日
Sorry for the late response. You were right! SVD should be applied on yi then the final matrix can be re-composed using orthogonal matrices and inverse of the diagonal matrix. I'm now facing "out of memory error", which does not make any sense to me as there is a lot more RAM on my PC than matlab requires. .Anyways, I'll raise it on another topic. Thanks, Oguzhan.

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

カテゴリ

Help Center および File ExchangeLinear Algebra についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by