help-octave
[Top][All Lists]
Advanced

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

Re: equivalent for C-style init: structname varname[] = {...} ?


From: Jordi Gutiérrez Hermoso
Subject: Re: equivalent for C-style init: structname varname[] = {...} ?
Date: Wed, 14 Nov 2012 11:19:03 -0500

On 14 November 2012 11:14, Yury T. <address@hidden> wrote:
> Jordi Gutiérrez Hermoso-2 wrote
>> ...
>>> and simple selective access to items by key of arbitrary type
>>> ("select item with ID=anything").
>>
>> This sort of thing allows that:
>>
>>     s(cellfun(@isempty, strfind({s.ID}, "Buffat")))
>>
>>     s(cellfun(@isempty, strfind({s.data}, "Buffat")))
>>
>> Look at the ingredients in there. First strfind to get the indices
>> where that "Buffat" string appears, the cellfun with @isempty to
>> convert to a boolean index, then using this index to index into s
>> again.
>> ...
>
> Arrgh! :) Sorry, I'd better go with Sergei's solution or with R, indeed.
> Thank you all the same.

Sergei's if anything, is gonna be even *more* complicated, because
you'll have to replace {s.data} with a bigger expression so you can
select the ones you want.

- Jordi G. H.


reply via email to

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