MATLAB Answers

Statistical Analyses Across Structures

1 view (last 30 days)
Alex Borg
Alex Borg on 23 Sep 2020
Answered: Star Strider on 24 Sep 2020
Hello everyone:
I have created a structure, and I'd like to perform some analyses about it. The structure may not be formatted most ideally, but that isn't what I'm most concerned with (unless it should be).
S(1), S(2), S(3), and S(4) represent four trials of a simulation. I'd like to perform statistical analysis across simulations (say, four boxplots, one for each of the "time" columns).
I tried converting this large structure to a table, then using grpstats, but that seems more trouble than it's worth. Any suggestions would be greatly appreciated!

  0 Comments

Sign in to comment.

Answers (1)

Star Strider
Star Strider on 24 Sep 2020
I am not certain what you want to do.
For the boxplot, try this:
D = load('structure.mat');
S = D.S;
for k1 = 1:numel(S)
for k2 = 1:numel(S(1).s)
t(k1,k2) = S(k1).s(k2).time;
end
end
figure
boxplot(t.')
grid
xlabel('S')
ylabel('time')
figure
boxplot(t)
xlabel('time')
ylabel('S')
Fh = gcf;
pos = Fh.OuterPosition;
Fh.OuterPosition = pos + [0 -500 750 500];
The loop was necessary to recover the information from your structure.
I have no idea what you are doing, so I likely cannot help on any further statistical analyses.

  0 Comments

Sign in to comment.

Products


Release

R2020a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by