[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Strcmp not behaving as expected
From: |
Ben Abbott |
Subject: |
Re: Strcmp not behaving as expected |
Date: |
Sun, 21 Oct 2012 19:53:44 -0400 |
On Oct 21, 2012, at 11:10 AM, Mumble07 <address@hidden> wrote:
> I'm writing a fairly simple plotting function in Octave with a number of
> filenames, and I have a number of string comparison commands to sort the
> datasets. The problem is, the program kept behaving oddly, and after some
> investigation, it seems that strcmp was the culprit and is acting completely
> randomly with respect to the documentation.
>
> Examples:
>
> strcmp ('vent', 'vent')
>
> returns
>
> error: A(J,I): row index out of bounds; value 118 out of bound 114
>
> and
>
> strcmp ('g_90', 'vent')
>
> returns a 4x4 unit matrix.
>
> meanwhile
>
> strcmp ('g_90', 'nograv')
>
> returns a 4x6 matrix with 1's in the first and last columns and 0's
> everywhere else.
>
> I have a few other examples, but in general, strcmp is not reliably
> comparing strings.
What version of Octave are you running? And what does "which strcmp" return?
Ben
- Strcmp not behaving as expected, Mumble07, 2012/10/21
- Re: Strcmp not behaving as expected,
Ben Abbott <=
- Re: Strcmp not behaving as expected, Mumble07, 2012/10/22
- Re: Strcmp not behaving as expected, c., 2012/10/22
- Re: Strcmp not behaving as expected, Martin Helm, 2012/10/22
- Re: Strcmp not behaving as expected, Mumble07, 2012/10/22
- Re: Strcmp not behaving as expected, Martin Helm, 2012/10/22
- Re: Strcmp not behaving as expected, Mumble07, 2012/10/22
- Re: Strcmp not behaving as expected, Mumble07, 2012/10/22
- Re: Strcmp not behaving as expected, Jordi GutiƩrrez Hermoso, 2012/10/22
- Re: Strcmp not behaving as expected, Martin Helm, 2012/10/22
- Re: Strcmp not behaving as expected, Jordi GutiƩrrez Hermoso, 2012/10/22