0001 function [version,NChan_file,NMeg,NReference,NEeg,NAnalog,NBad_chan,bad_chan,NEpoch,Epoch,nfreq] = rd_meg_csdm_hdr(csdmfname);
0002
0003
0004
0005
0006 if isempty(csdmfname)
0007 [fid,csdmfname] = get_fid('rb');
0008 fclose(fid);
0009 end;
0010
0011 csdmfid = open_file_w_byte_order(csdmfname,-1);
0012
0013 version = fread(csdmfid,1,'integer*2');
0014 NChan_file = fread(csdmfid,1,'integer*2');
0015 NMeg = fread(csdmfid,1,'integer*2');
0016 NReference = fread(csdmfid,1,'integer*2');
0017 NEeg = fread(csdmfid,1,'integer*2');
0018 NAnalog = fread(csdmfid,1,'integer*2');
0019 NBad_chan = fread(csdmfid,1,'integer*2');
0020 bad_chan = fread(csdmfid,[1,NBad_chan],'integer*2');
0021 NEpoch = fread(csdmfid,1,'integer*2');
0022 Epoch = fread(csdmfid,1,'real*4');
0023 nfreq = fread(csdmfid,1,'integer*2');
0024 fclose(csdmfid);
0025
0026