Reputation: 33
I am working with parallel execution in MATLAB. How can I access the data inside Structure inside Class ? This is the code :
>> clust
clust =
Lab 1: class = struct, size = [1 2]
Lab 2: class = struct, size = [1 2]
Lab 3: class = struct, size = [1 2]
Lab 4: class = struct, size = [1 2]
>> [clust{1}]
ans =
1x2 struct array with fields:
Data
Upvotes: 0
Views: 334
Reputation: 25160
clust
is a Composite
, which behaves a little like a cell
array, so using {}
indexing is correct to extract the value from a single worker. Those values are arrays of struct
, and can be accessed in the usual way. So, it should work to do this
V1 = clust{1};
D = V1(1).Data
Upvotes: 1