Skip to content

Commit

Permalink
Fixed a bug related to fread and MATLABN 2020a.
Browse files Browse the repository at this point in the history
  • Loading branch information
kianabc committed Jun 11, 2020
1 parent 5f94ecd commit 84e7e1d
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
2 changes: 1 addition & 1 deletion NPMK/Other tools/openCCF.m
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
end;

%% Read header incl. version
head = fread(fid, 16, '*char*1' )';
head = fread(fid, 16, 'uint8=>char*1' )';

if strcmp(head(1:5), 'cbCCF')
version = deblank(strtrim(head(6:end))); % Strip possible leading space and trailing nulls
Expand Down
7 changes: 6 additions & 1 deletion NPMK/Versions.txt
Original file line number Diff line number Diff line change
Expand Up @@ -420,5 +420,10 @@ NPMK Version 2.8.2.0: 5 May 2014
% - Fixed an error where N-Trodes with less than 4 members read an extra
% 1 as the extra non-existent members.

***** NPMK Version 5.2.1.0 :June 11, 2020 *****

LATEST:5.2.0.0
% openNSx 7.1.1.0: June 11, 2020
% - Fixed a bug related to fread and MATLAB 2020a.


LATEST:5.2.1.0
7 changes: 5 additions & 2 deletions NPMK/openNSx.m
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,9 @@
% a non-zero start time. (David Kluger)
% - Bug fixes and documentation updates (David Kluger)
%
% 7.1.1.0: June 11, 2020
% - Fixed a bug related to fread and MATLAB 2020a.
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%% Defining the NSx data structure and sub-branches.
Expand Down Expand Up @@ -464,10 +467,10 @@
fileFullPath = fullfile(path, fname);
[NSx.MetaTags.FilePath, NSx.MetaTags.Filename, NSx.MetaTags.FileExt] = fileparts(fileFullPath);

NSx.MetaTags.FileTypeID = fread(FID, [1,8] , '*char');
NSx.MetaTags.FileTypeID = fread(FID, [1,8] , 'uint8=>char');
if strcmpi(NSx.MetaTags.FileTypeID, 'NEURALSG')
NSx.MetaTags.FileSpec = '2.1';
NSx.MetaTags.SamplingLabel = fread(FID, [1,16] , '*char');
NSx.MetaTags.SamplingLabel = fread(FID, [1,16] , 'uint8=>char');
NSx.MetaTags.TimeRes = 30000;
NSx.MetaTags.SamplingFreq = NSx.MetaTags.TimeRes / fread(FID, 1 , 'uint32=>double');
ChannelCount = double(fread(FID, 1 , 'uint32=>double'));
Expand Down

0 comments on commit 84e7e1d

Please sign in to comment.