Matrix reduction

I have a very large set of data of over 1000 readings in [A]. I need to reduce the data to 101 readings evenly spaced over the original data set. Can anyone give me some help, or point me in the right direction? Any help would be much appreciated.

 採用された回答

Matt Fig
Matt Fig 2011 年 3 月 29 日

2 投票

If DAT is your original data.
NewDAT = DAT(round(linspace(1,length(DAT),101)))

3 件のコメント

Jason
Jason 2011 年 3 月 29 日
The DAT is a (3529,2), when I do what you suggested it gives me a (101,1). My data is (T,R) matrix as in readings vs time. What I need is 101 samples of the data with the time and the value associated with the time. I am new to MatLab, only been working with it for a few months so I not know a lot of the functionality of it.
Matt Tearle
Matt Tearle 2011 年 3 月 29 日
NewDAT = DAT(round(linspace(1,length(DAT),101)),:)
Indexing in MATLAB is A(row,column). Using : in place of column gives all columns (for the specified rows).
Jason
Jason 2011 年 3 月 29 日
Thank you, that worked perfectly

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

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeResizing and Reshaping Matrices についてさらに検索

質問済み:

2011 年 3 月 29 日

Community Treasure Hunt

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

Start Hunting!

Translated by