Home > eeg > egis > meg_code > open_file_w_byte_order.m

open_file_w_byte_order

PURPOSE ^

[fid] = open_file_w_byte_order(filename,version_parameter);

SYNOPSIS ^

function [fid] = open_file_w_byte_order(filename,version_parameter);

DESCRIPTION ^

 [fid] = open_file_w_byte_order(filename,version_parameter);

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function [fid] = open_file_w_byte_order(filename,version_parameter);
0002 % [fid] = open_file_w_byte_order(filename,version_parameter);
0003 %
0004 %
0005 fid = fopen(filename,'rb','n');
0006 version = fread(fid,1,'int16');
0007 
0008 if version ~= version_parameter
0009     fclose(fid);
0010     fid = fopen(filename,'rb','b');
0011     version = fread(fid,1,'int16');
0012 end;
0013 
0014 if version ~= version_parameter
0015     fclose(fid);
0016     fid = fopen(filename,'rb','l');
0017     version = fread(fid,1,'int16');
0018 end;
0019 
0020 if version ~= version_parameter
0021     error('tried both byte orders. this is not the right type of file');
0022 end;
0023 
0024 frewind(fid);

Generated on Wed 20-Sep-2023 04:00:50 by m2html © 2003