I need to concatenate few bigger matrices, but in specific manner - for example to concatenate only 1 row from X matrices. There is a good solution of storing the data in a structure, so then there is no need of preparing long list of things that needs to be concatenated.
For example, we will have a structure like that:
struct(1).huge = [1 2 3 4; 1 2 3 4];
struct(2).huge = [1 2 3 4; 1 2 3 4];
struct(3).huge = [1 2 3 4; 1 2 3 4];
Then we can concatenate these with:
concatVar.concat = vertcat(struct.huge);
Instead of, for example:
concatVar.concat = vertcat(struct(1), struct(2),(...),struct(100));
But what if I need to concatenate only specific rows from different fields in the structure, for example only 1 row:
concatVar.concat = vertcat(struct.huge(1,:));
Then this method will not work, with the error:
"Expected one output from a curly brace or dot indexing expression, but there were X results".
Is it even possible of doing something like that in a fast and reliable way with use of vertcat or horzcat?
Thanks for any advice! BM
struct(ii).huge), you don't need thathugename there.