| Products & Services | Industries | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → Statistics Toolbox |
| Contents | Index |
| Learn more about Statistics Toolbox |
Resize categorical array
B = reshape(A,M,N)
B = reshape(A,m,n,p,...)
reshape(A,[m
n p ...])
B = reshape(A,...,[],...)
B = reshape(A,M,N) returns an m-by-n categorical matrix whose elements are taken columnwise from the categorical array A. An error results if A does not have m*n elements.
B = reshape(A,m,n,p,...) or reshape(A,[m n p ...]) returns an array with the same elements as A but reshaped to have the size m-by-n-by-p-by-... . m*n*p*... must be the same as numel(A).
B = reshape(A,...,[],...) calculates the length of the dimension represented by[], such that the product of the dimensions equals numel(A). numel(A) must be evenly divisible by the product of the known dimensions. You can use only one occurrence of [].
In general, reshape(A,siz) returns an array with the same elements as A but reshaped to the size siz. prod(siz) must be the same as numel(A).
![]() | reset (qrandstream) | ridge | ![]() |

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.
| © 1984-2009- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |