Skip to content

Commit 7e6b2ac

Browse files
committed
correct calls to gettimes.
1 parent 3e70d8f commit 7e6b2ac

File tree

1 file changed

+5
-4
lines changed
  • src/tools_lgpl/matlab/quickplot/progsrc

1 file changed

+5
-4
lines changed

src/tools_lgpl/matlab/quickplot/progsrc/samples.m

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -465,18 +465,19 @@
465465
% case, we might want to sort them, but we haven't implemented that
466466
% yet.
467467
%
468+
timeLabels = xyz.Params(xyz.Time);
468469
if ~isempty(crds)
469470
sortloc = unique(xyz.XYZ(:,crds),'rows');
470471
nLoc = size(sortloc,1);
471472
nVal = size(xyz.XYZ,1);
472473
locations = xyz.XYZ(1:nLoc,crds); % alternatively use unique(...,'stable')
473474
if nVal/nLoc == floor(nVal/nLoc) && isequal(xyz.XYZ(:,crds),repmat(locations,[nVal/nLoc 1]))
474-
Times = gettimes(xyz.XYZ(1:nLoc:nVal,xyz.Time));
475+
Times = gettimes(xyz.XYZ(1:nLoc:nVal,xyz.Time),timeLabels);
475476
iTime = cumsum(repmat((1:nLoc)'==1,[nVal/nLoc 1]));
476477
end
477478
end
478479
if isempty(iTime)
479-
[Times,idum,iTime] = unique(gettimes(xyz.XYZ(:,xyz.Time),xyz.Params(xyz.Time)),'stable');
480+
[Times,idum,iTime] = unique(gettimes(xyz.XYZ(:,xyz.Time),timeLabels),'stable');
480481
nLoc = hist(iTime,max(iTime));
481482
end
482483
%
@@ -524,12 +525,12 @@ function Local_write_samples(filename,header,format,xyz)
524525
fclose(fid);
525526

526527

527-
function Times = gettimes(Times,ColLabels)
528+
function Times = gettimes(Times,timeLabels)
528529
if size(Times,2)==2 % gpp => 20140118 105120
529530
d = Times(:,1);
530531
s = Times(:,2);
531532
else
532-
switch ColLabels{1}
533+
switch lower(timeLabels{1})
533534
case 'time (min)'
534535
Times = Times/1440;
535536
return

0 commit comments

Comments
 (0)