octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #51187] ISMEMBER fails if the string ends in a


From: Guillaume
Subject: [Octave-bug-tracker] [bug #51187] ISMEMBER fails if the string ends in a space:
Date: Wed, 7 Jun 2017 07:01:24 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:50.0) Gecko/20100101 Firefox/50.0

Follow-up Comment #5, bug #51187 (project octave):

When the input is a char array, it seems that it is transformed to a cell
array in Matlab (with spaces stripped):


>> ismember(strvcat('a ','bc'),{'a ','bc'})

ans =

  2×1 logical array

   0
   1


so a fix could be:


if (size(x,1) == 1)
  x  = {x};
else
  x = cellstr (x);
endif


    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?51187>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]