Mercurial > octave
view test/bug-54490.tst @ 30204:1cd077e9f127
allow nchoosek to accept character vectors (bug #61199)
* nchoosek.m: Allow input of possible values to be a character array.
Ensure output is the same type as array of possible values. New
tests.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Thu, 23 Sep 2021 00:00:12 -0400 |
parents | 9080316864bf |
children |
line wrap: on
line source
%!function out = bug54490 () %! global k; %! k = 1; %! out = 3; %!endfunction %!test <*54490> %! global k; %! k = 2; %! a = [5, 6]; %! a(k) = bug54490 (); %! assert (a, [5, 3]); %! k = 2; %! a = [5, 6]; %! [a(k)] = bug54490 (); %! assert (a, [5, 3]); %! clear -global k; # cleanup after test