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

📄 binread.m

📁 toolbox of BVQX, This is the access between BV and matlab. It will help you to analysis data from BV
💻 M
字号:
function bincont = binread(filename)
% binread  - reads a binary into one uint8 array
%
% FORMAT:       bincont = binread(filename)
%
% Input fields:
%
%       filename    name to a file, preferably absolute path
%
% Output fields:
%
%       bincont     1xN uint8 array
%
% See also asciiread, binwrite

% Version:  v0.7b
% Build:    7083014
% Date:     Aug-30 2007, 2:52 PM CEST
% Author:   Jochen Weber, Brain Innovation, B.V., Maastricht, NL
% URL/Info: http://wiki.brainvoyager.com/BVQXtools

% enough arguments ?
if nargin < 1 || ...
   ~ischar(filename) || ...
    isempty(filename)
    error( ...
        'BVQXtools:BadArgument',...
        'Bad or missing argument. Try ''help %s''.',...
        mfilename ...
    );
end

% file exist check
filename = filename(:)';
if exist(filename, 'file') ~= 2
    error( ...
        'BVQXtools:FileNotFound',...
        'File not found: %s',...
        filename(1:min(length(filename), 80)) ...
    );
end

% open file check
fp = fopen(filename, 'r');
if fp < 1
    error( ...
        'BVQXtools:FileNotReadable',...
        'File not readable: %s',...
        filename ...
    );
end

% read file contents
bincont = fread(fp, [1, Inf], '*uint8');
fclose(fp);

⌨️ 快捷键说明

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