Skip to content

Commit

Permalink
Merge pull request #15 from Ergo-Tools/next-version
Browse files Browse the repository at this point in the history
Version 1.55
  • Loading branch information
pasan-h authored Mar 26, 2023
2 parents 44ab82b + 8d91f1a commit d93f22a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 15 deletions.
8 changes: 3 additions & 5 deletions utils/readActGT3xcsv.m
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
% Data [Nx4] datetime (Matlab datenum format) and triaxial Acc data
% SF [double] sample frequency
% deviceID [string] the device ID


%
%
% Copyright (c) 2021, Pasan Hettiarachchi .
% All rights reserved.
%
Expand Down Expand Up @@ -41,11 +41,9 @@
Data=[];
SF=NaN;
deviceID=NaN;

try


%Import of data from csv-file:

Rec = importdata(Fil,',');
headLs=string(Rec.textdata(:,1));
%parse the text data in header
Expand Down
12 changes: 2 additions & 10 deletions utils/readActivPALcsv.m
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@
% SF [double] sample frequency
% deviceID [string] the device ID
% ID [string] the participant ID



%
% Copyright (c) 2021, Pasan Hettiarachchi .
% All rights reserved.
%
Expand Down Expand Up @@ -43,8 +41,6 @@
[~,FileName] = fileparts(Fil);

try


patSN_ID = (textBoundary|"-")+alphanumericsPattern+"-AP" + digitsPattern(6) + whitespaceBoundary;
textSN_ID=extract(FileName,patSN_ID);
if ~isempty(textSN_ID)
Expand All @@ -55,16 +51,13 @@

ID=FileName;
deviceID=NaN;

end

%Import af data fra csv-datafilen:

Rec = importdata(Fil,';',2);

time = Rec.data(:,1);


it = Rec.data(:,2); %sampleindex
Acc = Rec.data(:,size(Rec.data,2)-2:size(Rec.data,2)); %last 3 columns
clear Rec
Expand All @@ -81,8 +74,7 @@

Data=zeros(length(t),4);
Data(:,1)=x2mdate(t);



if max(max(Acc))> 255 % if any number exceed 255 the file must be a AP4 file
Grange = 2*4; %range +/-4G
Data(:,2:4) = (Acc-(1023+4)/2) * (Grange/(1023-4));
Expand Down

0 comments on commit d93f22a

Please sign in to comment.