⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 eeg_write.m

📁 Matlab下的EEG处理程序库
💻 M
字号:
function eeg_write(file,data,PRECISION)
% EEG_WRITE - Write matrix of EEG data into binary file
%
% Useage:   eeg_write(file,data,PRECISION)
%
% where:    'file' is the path + filename, eg "c:\data.dat"
%           'data' is a matlab variable
%           'PRECISION' is a binary format ('double' default, see fread)
%
% comment:  Uses the fwrite method to output both 'size(data)' and
%           data. The size(data) integers are written first and used
%           by 'eeg_load' to determine the size of the data matrix.
%           All files are 'ieee-le'.
%

% $Revision: 1.2 $ $Date: 2003/03/02 03:20:43 $

% Licence:  GNU GPL, no express or implied warranties
% History:  07/2001, Darren.Weber@flinders.edu.au
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

if ~exist('PRECISION','var'), PRECISION = 'double'; end

[path,name,ext] = fileparts(file);
file = fullfile(path,[name ext]);

fid = fopen(file,'w','ieee-le');

% Write magicN data file size
magicN = size(data);
count = fwrite(fid,magicN,'int');
    
% Write the rest of the data
count = fwrite(fid,data,PRECISION);  fclose(fid);

fprintf('EEG_WRITE: Wrote %d bytes to:\t%s\n', count, file);

return

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -