假设我有这样的结构:
Results(i,j).fo
Results(i,j).co
其中i=19
和j=30
。如何将所有 Results(i,j).fo
保存在 ixj
矩阵中?或者甚至更好,我怎样才能对 bootci
说只读取 Results(i,j).fo
Media_tot = mean(Matrix,2)
ci = bootci(1000, @mean, Matrix');
ci = abs(ci' - repmat(Media_tot,1,2));
hE = errorbar(xdata_m, ydata_m, ci(:,1), ci(:,2));
最佳答案
我认为这应该适用于您的第一个问题:
reshape([Results.fo], 19, 30)
例如
%// Make a 3x3 matrix of structs with 2 fields
A = [];
for k = 1:9
A(k).x = k;
A(k).y = 9-k;
end
A= reshape(A,3,3)
现在
reshape([A.x], 3,3)
ans =
1 4 7
2 5 8
3 6 9
和
reshape([A.y], 3,3)
ans =
8 5 2
7 4 1
6 3 0
关于matlab - 从结构体到数组,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19837377/