On Fri, May 14, 2010 at 11:37 PM, Lukas Reichlin <[email protected]> wrote: > Dear Octave Community > > I have a struct "quaternion" with fields w, x, y and z. The fields are > matrices. > > Next I build a cell array "qcell" which contains quaternions. > > Now I can access fields with qcell{2}.w > > However, qcell{:}.w doesn't seem to work. > > How can I extract those fields? Thanks for every help! >
Basically, you can't. There is no simple way. Instead of building a cell array of scalar structs, it's better to build a non-scalar struct: qstr = cellfun (@quaternion, varargin); # uniformoutput = true ! w = horzcat (qstr.w); x = horzcat (qstrl.x); y = horzcat (qstr.y); z = horzcat (qstr.z); -- RNDr. Jaroslav Hajek, PhD computing expert & GNU Octave developer Aeronautical Research and Test Institute (VZLU) Prague, Czech Republic url: www.highegg.matfyz.cz ------------------------------------------------------------------------------ _______________________________________________ Octave-dev mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/octave-dev
