help-octave
[Top][All Lists]
Advanced

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

strcmp with cell array does not work


From: ash
Subject: strcmp with cell array does not work
Date: Thu, 27 Dec 2012 03:48:16 -0800 (PST)

Hi all.

I have two cell-arrays of strings and I need to compare them.
they are :

 hdr.x
ans = 
{
  [1,1] = aaa

  [2,1] = abc

  [3,1] = cde

  [4,1] = efg

  [5,1] = sdfg

  [6,1] = sd34

}

octave:16> hdr.y
hdr.y = 
{
  [1,1] = sdfg
  [2,1] = yyy
  [3,1] = rrr
  [4,1] = erty6
}

when i use strcmp(hdr.y,hdr.x(5))
it returns 0. why, if the first element of hdr.y is the same of the fifth of
hdr.x ?

If i use strcmp(hdr.y(1),hdr.x(5)) it returns 0 again!
I'm confused.
The same strcmp with the same arrays in matlab seem to work.

Octave version 3.6.1




--
View this message in context: 
http://octave.1599824.n4.nabble.com/strcmp-with-cell-array-does-not-work-tp4648407.html
Sent from the Octave - General mailing list archive at Nabble.com.


reply via email to

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