octave-maintainers
[Top][All Lists]
Advanced

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

Re: Error with pkg.m (== isspace does work with cell arrays anymore)


From: Daniel J Sebald
Subject: Re: Error with pkg.m (== isspace does work with cell arrays anymore)
Date: Mon, 25 Feb 2008 21:15:21 -0600
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.3) Gecko/20041020

John W. Eaton wrote:
On 25-Feb-2008, Daniel J Sebald wrote:

| so why couldn't we do:
| | octave:34> filenames{:}(:)
| error: can't perform indexing operations for cs-list type
| octave:34>
| | in the instance where every element of the list is a character?

Because a comma separated list (the result of something like
filenames{:}) is not something that can be assigned a single variable.
Think of it as an argument list, not a single object.

Oh, OK... Wait, got it.  Try this syntax:

octave:1> filenames = {'this' 'is' 'a' 'test'}
filenames =

{
 [1,1] = this
 [1,2] = is
 [1,3] = a
 [1,4] = test
}

octave:2> [filenames{}]
ans = thisisatest
octave:3> isspace([filenames{}])
ans =

  0   0   0   0   0   0   0   0   0   0   0

octave:4> filenames2 = {' ' ' ' ' ' ' '}
filenames2 =

{
 [1,1] =
 [1,2] =
 [1,3] =
 [1,4] =
}

octave:5> isspace([filenames2{}])
ans =

  1   1   1   1

octave:6>


It's actually kind of nice it works that way.  Does that work for you Michael?  Replacing all 
"filenames" by "[filenames{}]" in pkg.m?

Dan


reply via email to

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