How do I access data field in spmd block?
I have the following code --
function output = spmd_fieldname_test(input)
spmd
input = distributed(input);
allFieldnames = fieldnames(input);
for ithField = 1:numel(allFieldnames)
output = vertcat(input.(allFieldnames{ithField}));
end
end %spmd
end %function
However, I've got the following error -
Error using codistributed/subsref (line 27)
Distributed SUBSPEF currently only supports () indexing.
So, does this mean that I have to do struct2cell and perform my own fieldname index keeping in this case?