I have an 8x18 structure with each cel containing the column vector of the occurrence of a single event. I want to get data from some of these fields combined into one array, without having to scroll through them. I canβt find a way to vertically concatenate the fields that interest me in a single array.
As an example, I create the following structure: from 1 to 5 entries in a cell:
s(62).vector(8,18).heading.occurrences=[1;2;3]; for i=1:62 for j=1:8 for k=1:18 y=ceil(rand(1)*5); s(i).vector(j,k).heading.occurrences=rand(y,1); end end end
Now, if you want to get all occurrences in several cells, while maintaining the i constant for the instant i=1 , follow these steps:
ss=s(1).vector([1 26 45]); h=[ss.heading]; cell2mat({h.occurrences}')
Now I would like to do the same for s , for example s([1 2 3]).vector([1 26 45]) , how will this work? I tried xx=s([1 2 3]) , yy=xx.vector([1 26 45]) , but this, however, leads to an error:
Expected result from braces or indexing indexing points, but there were 3 results.
Is this also possible with vector operation?
source share