?? eeg_load.m
字號(hào):
function [volt] = eeg_load(FILENAME,SIZE,PRECISION)
% EEG_LOAD - Load binary EEG data
%
% Can be used to easily load files written by 'eeg_write'. Otherwise,
% can be used to load a binary matrix data file.
%
% Useage: [volt] = eeg_load(filename,SIZE,PRECISION)
%
% where: 'filename' is the full path + fileprefix + filextension
% 'SIZE' is [M,N] rows by columns; if omitted, SIZE can
% be read from any data files written by 'eeg_write' but
% otherwise all data is read into an 1D array.
% 'PRECISION' is the data type (default is 'double').
% See matlab fread command for more info on size/precision.
%
% comment: A simple wrapper for 'fread' matlab function, useful in
% other scripts. This is complementary to 'eeg_write'.
%
% $Revision: 1.2 $ $Date: 2003/03/02 03:20:43 $
% Licence: GNU GPL, no express or implied warranties
% History: 07/2000, Darren.Weber@flinders.edu.au
% 04/2002, Darren.Weber@flinders.edu.au
% added machineformat
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
if ~exist('PRECISION','var'), PRECISION = 'double'; end
file = char(FILENAME);
[path,name,ext] = fileparts(file);
file = fullfile(path,[name ext]);
if ~isequal(exist(file),2),
lookfile = which(file);
if isempty(lookfile),
msg = sprintf('Cannot locate %s\n', file);
error(msg);
else
file = lookfile;
end
end
fprintf('EEG_LOAD: Reading:\n... %s : ', file);
fid = fopen(file,'r','ieee-le');
if ~exist('SIZE','var'),
[SIZE, COUNT] = fread(fid,[1,2],'int');
end
[volt, COUNT] = fread(fid,SIZE,PRECISION);
S = size(volt); fprintf('%d rows, %d cols\n', S(1), S(2) );
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -