Info

此问题已关闭。 请重新打开它进行编辑或回答。

Statistical Analyses Across Structures

1 次查看(过去 30 天)
Alex Borg
Alex Borg 2020-9-23
关闭: MATLAB Answer Bot 2021-8-20
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!

回答(1 个)

Star Strider
Star Strider 2020-9-24
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.

产品


版本

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by