Identifying a repeating number in a large data file

1 回表示 (過去 30 日間)
Sanwal Yousaf
Sanwal Yousaf 2015 年 7 月 28 日
編集済み: Cedric 2015 年 7 月 29 日
I am trying to write a function that deals with large amount of data collected from EEG electrodes using EEG lab. I am trying to write a function that finds a number, say 9, in a large data retrieved from the experimental results and i could later use the indexing of these occurring 9s which may or may not occur at the same interval. I would also like to use this indexing of the 9 to be able to do number manipulation with the 9 and 2 numbers to its left and 2 to its right. Anybody got any ideas about the sort of functions that i should look at to achieve this??

採用された回答

Azzi Abdelmalek
Azzi Abdelmalek 2015 年 7 月 28 日
編集済み: Azzi Abdelmalek 2015 年 7 月 28 日
A function that finds these numbers is find
Example:
A=[1 2 3 9 4 5 6 8 9 10 1 0 5]
idx1=A==9
idx2=find(A==9)
See also ismember function
  2 件のコメント
Sanwal Yousaf
Sanwal Yousaf 2015 年 7 月 29 日
Could you use this to find an number from a http://www.mathworks.com/help/matlab/ref/uigetfile.html function.
Say,i use the uiget function to obtain the file, then could find still be used??
Cedric
Cedric 2015 年 7 月 29 日
編集済み: Cedric 2015 年 7 月 29 日
UIGETFILE will just give you a file name and a directory (as strings). If you do
[fileName, pathName] = uigetfile( '*.txt' ) ;
you just trigger a file selection window, which returns the location of the file. Then you have to build the full path/locator:
locator = fullfile( pathName, fileName ) ;
and then read the file content. Depending what format it is, you can use IMPORTDATA, TEXTSCAN, XLSREAD, etc. For example:
A = xlsread( locator ) ;
After reading the file, and possibly making a few data conversions, you have an array of numbers that you can process the way Azzi explained if you are looking for given exact values.

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeEEG/MEG/ECoG についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by