changeset 30982:95cb7ebba1a9

maint: Merge stable to default.
author Markus Mützel <markus.muetzel@gmx.de>
date Thu, 05 May 2022 20:50:18 +0200
parents e33444cd822f (current diff) 1ce1c4552d5b (diff)
children 7711b5e38ebc
files
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/time/datenum.m	Thu May 05 19:26:09 2022 +0200
+++ b/scripts/time/datenum.m	Thu May 05 20:50:18 2022 +0200
@@ -136,8 +136,7 @@
       endif
       ## Preserve shape if necessary, and work with column vectors
       ## for the remainder of the function.
-      do_reshape = (columns (year) > 1 || columns (month) > 1
-                    || columns (day) > 1);
+      do_reshape = ! iscolumn (day);
       if (do_reshape)
         sz_reshape = size (day);
         year = year(:);
@@ -217,6 +216,8 @@
 %! n = n';
 %! assert (datenum (t(1,:), t(2,:), t(3,:), t(4,:), t(5,:), t(6,:)), n, 2*eps);
 
+%!assert (size (datenum (2000, 1, ones(1, 1, 3))), [1 1 3])
+
 ## Test fractional years including leap years
 %!assert (fix (datenum ([2001.999 1 1; 2001.999 2 1])), [731216; 731247])
 %!assert (fix (datenum ([2004.999 1 1; 2004.999 2 1])), [732312; 732343])