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

📄 resolve.m

📁 toolbox of BVQX, This is the access between BV and matlab. It will help you to analysis data from BV
💻 M
字号:
function y = resolve(htio)
% transio::resolve  - given entire contents in good dims
%
% FORMAT:       y = resolve(tio);
%
% Input fields:
%
%       tio         transio object
%
% Output fields:
%
%       y           data retrieved from transio object

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

% argument check
if nargin < 1 || ...
    numel(htio) ~= 1
    error( ...
        'transio:BadSubsRef', ...
        'No S subsref struct given.' ...
    );
end

% try retrieval
try
    fid = 0;
    if htio.LittleND
        fid = fopen(htio.FileName, 'rb', 'ieee-le');
    else
        fid = fopen(htio.FileName, 'rb', 'ieee-be');
    end
    if fid < 1
        error('FILE_NOT_OPEN');
    end
    fseek(fid, htio.IOOffset, -1);
    if ftell(fid) ~= htio.IOOffset
        error('FILE_SEEK_ERROR');
    end
    y = reshape(fread(fid, ...
        [prod(htio.DataDims), 1], ['*' htio.DataType]), htio.DataDims);
    fclose(fid);
    fid = 0;
catch
    if fid > 0
        fclose(fid);
    end
    error( ...
        'transio:FileReadError', ...
        'Error opening file / reading contens.' ...
    );
end

⌨️ 快捷键说明

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