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: Yury T.
Subject: Re: equivalent for C-style init: structname varname[] = {...} ?
Date: Wed, 14 Nov 2012 08:14:57 -0800 (PST)

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.




--
View this message in context: 
http://octave.1599824.n4.nabble.com/equivalent-for-C-style-init-structname-varname-tp4646460p4646668.html
Sent from the Octave - General mailing list archive at Nabble.com.


reply via email to

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