- Where Developers Learn, Share, & Build Careers
After
I have created a cell array of structure-files like this, for example:
& Gt; & Gt; Res2 res2 = column 1 through 7 [1x1 struct] [1x1 struct] [1x1 struct] [1x1 struct] [1x1 struct] [1x1 struct] column 8 to 10 [1x1 struct] [1x1 struct] [ 1x1 by struct] & gt; & Gt; Res2 {1} ans = nchi005_randchi005: 0.1061 nfdr_randfdr: 0.0011 nlgt_randlgt: 2.9517e-004 nphast_randphast: 0.6660 ndd_rand_dd: 0.0020 ndd_rand_dd_larger: 1 & gt; & Gt; Res2 {1} .nlgt_randlgt ans = 2.9517e-004 & gt; & Gt; Res {:}. Nlgt_randlgt ??? Bad Cell Reference Operation There is a possibility to access all of the nl2t_randlgt-fields of res2-cellarray at a time?
All you need to do is get a struct array from a cell array for your res2 < / Code> convert (using cell2mat ). You can then get the structure members in the same way you want. Here's an example, where cdat is a cell array of stricuttes with two members, s1 and s2 . cdt [[1x1 structure] [1x1 structure] [1x1 structure] [1x1 structure] [1x1 structure] [1x1 structure] [1x1 structure] [1x1 structure] [1x1 structure]> gt ; & Gt; Dat = cell2mat (cdat) = 1x10 struct array with Dat regions: S1 s2> & Gt; [date (:). S1] ans = 1 1 1 1 1 1 1 1 1
Comments
Post a Comment