matlab Permute Rearrange dimensions of N-D array
2012-07-09 14:23
218 查看
Syntax
B = permute(A,order)
Description
B = permute(A,order) rearranges the dimensions of A so that they are in the order specified by the vector order. B has the same values of A but the order of the subscripts needed to access any particular element is rearranged as specified by order. All the
elements of order must be unique.
Tips
permute and ipermute are a generalization of transpose (.') for multidimensional arrays.
Examples
Given any matrix A, the statement
permute(A,[2 1])
is the same as A.'.
For example:
A = [1 2; 3 4]; permute(A,[2 1])
ans =
1 3
2 4
The following code permutes a three-dimensional array:
X = rand(12,13,14);
Y = permute(X,[2 3 1]);
size(Y)
ans =
13 14 12
B = permute(A,order)
Description
B = permute(A,order) rearranges the dimensions of A so that they are in the order specified by the vector order. B has the same values of A but the order of the subscripts needed to access any particular element is rearranged as specified by order. All the
elements of order must be unique.
Tips
permute and ipermute are a generalization of transpose (.') for multidimensional arrays.
Examples
Given any matrix A, the statement
permute(A,[2 1])
is the same as A.'.
For example:
A = [1 2; 3 4]; permute(A,[2 1])
ans =
1 3
2 4
The following code permutes a three-dimensional array:
X = rand(12,13,14);
Y = permute(X,[2 3 1]);
size(Y)
ans =
13 14 12
相关文章推荐
- Rearrange an array of positive and negative integers
- matlab中发生Undefined function 'regessionLoop' for input arguments of type 'char'.
- What are the 3 dimensions of an RGB image in MATLAB?
- rearrange array (red, white, blue)
- matlab:draw of bar
- Using MATLAB to analyze principal components obtained from a molecular dynamics simulation of a pro
- MATLAB Toolbox Path Cache is out of date and is not being used的解决
- re.sub(r'\*(.+?)\*',r'<em>\1</em>','pages of *World Wide Spam*,')的理解
- matlab提示Undefined operator '*' for input arguments of type 'cell'.
- Examples of Hough Transfer and FFT(MATLAB)
- MATLAB报错“Exception in thread "FileDecorationCache request queue" java.lang.OutOfMemoryError: Java “
- Matlab出现On Startup: Error using eval undefined function 'workspacefunc' for input arguments of type
- MATLAB out of memory
- PHP build notes - WARNING: This bison version is not supported for regeneration of the Zend/PHP parsers (found: 3.0, min: 204, excluded: 3.0).
- Contracted Concept and Dimensions of International Law
- Matlab:random number generation of various distribution
- CrowdStrike unleashes CrowdRE to promote collaborative reverse engineering of malware
- CareerCup Given an array of (unsorted) integers, arrange them such that a < b > c < d > e... etc.
- Comparison of data analysis packages: R, Matlab, SciPy, Excel, SAS, SPSS, Stata
- MATLAB out of memory