How to separate specific data from a larger data set

I have a data .mat file that is 9 x 2233. The ninth row "labels" the column with a value of one through six. I want to know what to do to create a new array of all the columns that have the same value in the ninth row.
Full story: I'm running a Simulink simulation that collects data every millisecond. During this simulation, the user has to complete a pointing task. When the user hits the first target, a second one appears elsewhere. In this particular data set there are six targets. The .mat file collects the Simulink time, xyz position of the user and the target, real time, and target number. Row 9 is the target number and I want to create a new array of the data that is specific to target 1.
Do you have a suggestion for creating a new array of all the columns where row nine=1 ?
Thank you in advance.

 採用された回答

Matt Fig
Matt Fig 2011 年 6 月 10 日

0 投票

If your array is called A, then:
B = A(:,A(9,:)==3); % Take columns of A which have a 3 in row 9.

2 件のコメント

Julia
Julia 2011 年 6 月 10 日
Thank you! It worked beautifully
Matt Tearle
Matt Tearle 2011 年 6 月 10 日
LanguagesILike = AllLanguages(Indexing==Logical)

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

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeSimulation についてさらに検索

タグ

質問済み:

2011 年 6 月 10 日

Community Treasure Hunt

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

Start Hunting!

Translated by