From 4d1da157c62997f3413d6d1a351754acb0da4ec8 Mon Sep 17 00:00:00 2001 From: David Bradway Date: Fri, 10 Apr 2020 20:27:12 -0400 Subject: [PATCH] add commands to force integer indexing, close #3 Please verify that this does not produce any off-by-one errors. It may be worth looking at `ceil`, `floor`, `round`, and `fix` (note they may behave differently for positive and negative numbers). --- focusCoords.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/focusCoords.m b/focusCoords.m index 411ad80..657419e 100644 --- a/focusCoords.m +++ b/focusCoords.m @@ -11,5 +11,5 @@ icmat = zeros(size(coords,1),length(icvec)); for i=1:size(coords,1) - icmat(i,dd(i)+1:end) = icvec(1:end-dd(i)); + icmat(i,ceil(dd(i))+1:end) = icvec(1:end-ceil(dd(i))); end