select row in excel

1 回表示 (過去 30 日間)
mira
mira 2014 年 8 月 5 日
コメント済み: mira 2014 年 8 月 5 日
Hi, I have this data in excel
B B C A B B A B A A B B A B B A A C B B A A B B A B B A B A A B
and I have problem in extracting the rows. This is because the char (A, B, C) are in random rows. So how do I pick char (A), (B) and (C) in random rows?
Thank you.

回答 (1 件)

Hikaru
Hikaru 2014 年 8 月 5 日
I would use the code below to read the data into MATLAB.
[~,~, raw] = xlsread('filename.xlsx')
raw will be a cell array containing 'A', 'B', 'C' and [NaN]
I can't help more than this without the specifics. Are the letters stored in the same number of columns? If so, you could convert the letters into char string by
char(raw(i,:)) % i is the rows containing the letters
Note, char() won't work if the element contains NaN.
  1 件のコメント
mira
mira 2014 年 8 月 5 日
Actually I'm using Psychtoolbox and what I'm doing is when spacebar is pressed, it will recognized the char above. however, I do not manage to recognize the char.

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

カテゴリ

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

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by