三维阵列 [英] Three-dimensional array
问题描述
在一个分类的问题,我有数据,每个 C
类与电子
此数据的例子,和每个例子是重新按长度的特征向量psented˚F
$ p $。什么是重新present的最佳方式这个结构在Matlab?
In a classification problem, I have c
classes of data, each with e
examples of this data, and each example is represented by a feature vector of length f
. What's the best way to represent this structure in Matlab?
我可以使用 C-由-E
单元阵列,其中每个元素的长度为一维数组˚F
。不过,我想尽量避免使用电池阵列。如果我使用一个3D阵列,我不知道如何实现这一点。会是什么尺寸? (C,E,F)
或(F,E,C)
?
I could use a c-by-e
cell array, where each element is 1D array of length f
. However, I would like to avoid using cell arrays. If I use a 3D array, I'm not sure how to implement this. What would be the dimensions? (c, e, f)
or (f, e, c)
?
推荐答案
一般来说,最好放置最长的矢量一列。因此,(F,E,C)
应该比(C,E,F)
,假设˚F
的确是最长的尺寸。
Generally it's best to place the longest vector in a column. Therefore, (f, e, c)
should be better than (c, e, f)
, assuming that f
is indeed the longest dimension.
MATLAB是最有效的。
MATLAB is most efficient when working in columns, and many built-in functions are coded to work columnwise by default.
来源:<一个href=\"http://www.mathworks.com/help/images/using-columnwise-processing-to-speed-up-sliding-neighborhood-or-distinct-block-operations.html\" rel=\"nofollow\">http://www.mathworks.com/help/images/using-columnwise-processing-to-speed-up-sliding-neighborhood-or-distinct-block-operations.html.
这篇关于三维阵列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!