How to change the x increment in xy files?

1 回表示 (過去 30 日間)
Martin Suttle
Martin Suttle 2015 年 6 月 19 日
コメント済み: Star Strider 2015 年 6 月 19 日
I have a large number of infrared spectra, essentially xy data, saved as .csv files. The x increment or step for each spectra is different, e.g. one file may be every 0.5 (0, 0.5, 1 etc.) and another file every 0.75 (0, 0.75, 1.5) etc. I wish to restructure such that all data files have the same x increment. Ultimately I'm hoping to run least squares regression analysis between new spectra and the database I hold to find close matches. Could you give me some coding clues, please?

回答 (1 件)

Ingrid
Ingrid 2015 年 6 月 19 日
編集済み: Ingrid 2015 年 6 月 19 日
just use interp1 to set all data to the same x-vector via linear interpolation. If you have large datasets, you might want to use nakeinterp1 as it is much faster than the built in matlab function ( http://www.mathworks.com/matlabcentral/newsreader/view_thread/258413 )
  1 件のコメント
Star Strider
Star Strider 2015 年 6 月 19 日
The FEX submission interp1qr is also an option.

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

カテゴリ

Help Center および File ExchangeStatistics and Machine Learning Toolbox についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by