From: John W. E. <jw...@be...> - 2005-05-24 15:42:29
|
On 20-May-2005, Tom Holroyd wrote: | Here's one that does. This is based on JWE's strcmp. | | I collapsed the case | strncmp(cell array, string matrix, n) | to | strncmp(string matrix, cell array, n) | with the arguments reversed; the same thing could be done to strcmp. I included the strncmp function in Octave (both 2.9.x and 2.1.x). | I don't know if it's slower or faster, but it's easier to maintain, | certainly. There's a similar possible collapse in the cell, cell | case, but it looks like it might be a bit slower. Yes, it is likely to be slower because recursion is slow in Octave. But if you would like to make a similar change to strcmp.m now to make it simpler to maintain and more similar to the strncmp function, I would take the patch. Thanks, jwe |