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

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

[Octave-bug-tracker] [bug #59113] Warning when String property of a uico


From: Guillaume
Subject: [Octave-bug-tracker] [bug #59113] Warning when String property of a uicontrol is a char array
Date: Mon, 14 Sep 2020 12:53:37 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Firefox/68.0

Follow-up Comment #2, bug #59113 (project octave):

Thanks, Rik. When looking into uicontrol to see where the warnings were coming
from, I noticed this:


strcmp(char({'a','b'}),'a')
strcmp({char({'a','b'}),'a'},'a')
strcmp(char({'a','b'}),{char({'a','b'}),'a'})


Octave returns:


>> strcmp(char({'a','b'}),'a')
ans = 0
>> strcmp({char({'a','b'}),'a'},'a')
warning: multi-row character matrix converted to a string, only the first row
is used
ans =
  1  1
>> strcmp(char({'a','b'}),{char({'a','b'}),'a'})
warning: multi-row character matrix converted to a string, only the first row
is used
ans =
  1  0


while Matlab returns:


>> strcmp(char({'a','b'}),'a')
ans =
  logical
   0
>> strcmp({char({'a','b'}),'a'},'a')
ans =
  1x2 logical array
   0   1
>> strcmp(char({'a','b'}),{char({'a','b'}),'a'})
ans =
  1x2 logical array
   0   0


I'll open a separate bug report for pipe-delimited strings.

    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?59113>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

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