Mercurial > octave
changeset 33223:45b7805c2a67 stable
hist.m: Add input validation for Y restricting it to 2-D array (bug #65478)
* hist.m: Add input check on number of dimensions of Y.
author | Rik <rik@octave.org> |
---|---|
date | Tue, 19 Mar 2024 15:11:45 -0700 |
parents | 32002886fc7c |
children | d174bfd66e28 557fbfea93ab |
files | scripts/plot/draw/hist.m |
diffstat | 1 files changed, 4 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/scripts/plot/draw/hist.m Fri Mar 15 17:52:07 2024 +0100 +++ b/scripts/plot/draw/hist.m Tue Mar 19 15:11:45 2024 -0700 @@ -106,6 +106,10 @@ error ("hist: Y must be real-valued"); endif + if (ndims (y) > 2) + error ("hist: Y must be a 2-D array"); + endif + arg_is_vector = isvector (y); if (arg_is_vector) y = y(:);