|
From: | Luis Mendo |
Subject: | [Octave-bug-tracker] [bug #46897] nchoosek accepting non-numeric input |
Date: | Thu, 14 Jan 2016 14:49:49 +0000 |
User-agent: | Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.106 Safari/537.36 |
URL: <http://savannah.gnu.org/bugs/?46897> Summary: nchoosek accepting non-numeric input Project: GNU Octave Submitted by: lmendo Submitted on: jue 14 ene 2016 14:49:47 GMT Category: Octave Function Severity: 3 - Normal Priority: 5 - Normal Item Group: Matlab Compatibility Status: None Assigned to: None Originator Name: Luis Mendo Originator Email: Open/Closed: Open Discussion Lock: Any Release: 4.0.0 Operating System: Microsoft Windows _______________________________________________________ Details: I've noticed that Octave's nchoosek function requires the first input to be a scalar or a numeric vector. In Matlab it can be a char vector (i.e. string) or a row cell array. I think this is good because it extends functionality. It's very easy to generalize Octave's `unique` to do this, using a workaround: call builtin `unique` with a numeric vector and then use the result that to index into the original input. I'm attaching my workaround function. _______________________________________________________ File Attachments: ------------------------------------------------------- Date: jue 14 ene 2016 14:49:47 GMT Name: nchoosek_comp.m Size: 177B By: lmendo <http://savannah.gnu.org/bugs/download.php?file_id=36028> _______________________________________________________ Reply to this item at: <http://savannah.gnu.org/bugs/?46897> _______________________________________________ Mensaje enviado vía/por Savannah http://savannah.gnu.org/
[Prev in Thread] | Current Thread | [Next in Thread] |