23.12.2012 Views

MATLAB Function Reference Volume 1: A - E - Bad Request

MATLAB Function Reference Volume 1: A - E - Bad Request

MATLAB Function Reference Volume 1: A - E - Bad Request

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

2cell<br />

Purpose Create cell array<br />

Syntax c = cell(n)<br />

c = cell(m,n) or c = cell([m n])<br />

c = cell(m,n,p,...) or c = cell([m n p ...])<br />

c = cell(size(A))<br />

c = cell(javaobj)<br />

Description c = cell(n) creates an n-by-n cell array of empty matrices. An error message<br />

appears if n is not a scalar.<br />

c = cell(m,n) or c = cell([m,n]) creates an m-by-n cell array of empty<br />

matrices. Arguments m and n must be scalars.<br />

c = cell(m,n,p,...) or c = cell([m n p ...]) creates an m-by-n-by-p-...<br />

cell array of empty matrices. Arguments m, n, p,... must be scalars.<br />

c = cell(size(A)) creates a cell array the same size as A containing all empty<br />

matrices.<br />

c = cell(javaobj) converts a Java array or Java object, javaobj, into a<br />

<strong>MATLAB</strong> cell array. Elements of the resulting cell array will be of the<br />

<strong>MATLAB</strong> type (if any) closest to the Java array elements or Java object.<br />

Examples This example creates a cell array that is the same size as another array, A.<br />

A = ones(2,2)<br />

A =<br />

1 1<br />

1 1<br />

c = cell(size(A))<br />

c =<br />

[] []<br />

[] []<br />

The next example converts an array of java.lang.String objects into a<br />

<strong>MATLAB</strong> cell array.<br />

cell<br />

2-227

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!