I have a function that processes an individual data set, and stores the outcome metrics in a data set like so:

```
trial_data.output_metric_a.value_1 = 2;
...
trial_1 = trial_data;

```

This function is applied to a number of different trials and are stored as an array struct:

```
% trial_1.output_metric_a.value_1 = 4
% trial_2.output_metric_a.value_1 = 2
trials = [trial_1 ; trial_2];

```

Is it possible to get averages and standard deviations of the sub-field values
without looping through the data structure?

Ideally:

```
mean_trials = mean(trials)
mean_trials.output_metric_a.value_1 == 3 % true

```

A possible loop implementation to solve this could be (obviously this leaves much to be desired):

```
output_metric_a_value_1 = [];
...

for i:length(trials)
    output_metric_a_value_1(end+1) = trials(i).output_metric_a.value_1; 
    ... % For each output metric and value
end

mean_trials.output_metric_a.value_1 = mean(output_metric_a_value_1);

```