[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.
- Re: equivalent for C-style init: structname varname[] = {...} ?, (continued)
- Re: equivalent for C-style init: structname varname[] = {...} ?, Sergei Steshenko, 2012/11/13
- Re: equivalent for C-style init: structname varname[] = {...} ?, Yury T., 2012/11/14
- Re: equivalent for C-style init: structname varname[] = {...} ?, Jordi Gutiérrez Hermoso, 2012/11/14
- Re: equivalent for C-style init: structname varname[] = {...} ?, Yury T., 2012/11/14
- Re: equivalent for C-style init: structname varname[] = {...} ?, Jordi Gutiérrez Hermoso, 2012/11/14
- Re: equivalent for C-style init: structname varname[] = {...} ?, Yury T., 2012/11/14
- Re: equivalent for C-style init: structname varname[] = {...} ?,
Jordi Gutiérrez Hermoso <=
- Re: equivalent for C-style init: structname varname[] = {...} ?, Yury T., 2012/11/14
- Re: equivalent for C-style init: structname varname[] = {...} ?, Jordi Gutiérrez Hermoso, 2012/11/14
- Re: equivalent for C-style init: structname varname[] = {...} ?, Yury Tarasievich, 2012/11/14
- Re: equivalent for C-style init: structname varname[] = {...} ?, Jordi Gutiérrez Hermoso, 2012/11/14
- Re: equivalent for C-style init: structname varname[] = {...} ?, Yury T., 2012/11/14
- Re: equivalent for C-style init: structname varname[] = {...} ?, Sergei Steshenko, 2012/11/14
- Re: equivalent for C-style init: structname varname[] = {...} ?, Sergei Steshenko, 2012/11/14
- Re: equivalent for C-style init: structname varname[] = {...} ?, Yury T., 2012/11/14
- Re: equivalent for C-style init: structname varname[] = {...} ?, Jordi Gutiérrez Hermoso, 2012/11/15
- Re: equivalent for C-style init: structname varname[] = {...} ?, Sergei Steshenko, 2012/11/15