From f082a5de49c7707875707054afb3f8b9aacbc119 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Adjemian=20=28Charybdis=29?= <stepan@adjemian.eu> Date: Fri, 18 Dec 2020 20:01:11 +0100 Subject: [PATCH] Fixed round method with octave. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The round function in octave does not admit two arguments (the second being the rounding precision) as in recent versions of Matlab. The same trick should apply to old Matlab versions, but I do not know when Mathworks introduced the second argument… A simple solution could be to always use this trick, and never use the second argument. --- src/@dseries/round_.m | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/@dseries/round_.m b/src/@dseries/round_.m index 64944f2..197b352 100644 --- a/src/@dseries/round_.m +++ b/src/@dseries/round_.m @@ -38,7 +38,11 @@ for i=1:vobs(o) end end -o.data = round(o.data, n); +if isoctave + o.data = round(o.data*10^n)/10^n; +else + o.data = round(o.data, n); +end %@test:1 %$ % Define a dates object -- GitLab