This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

mxGPUSetDimensions (C)

Modify number of dimensions and size of each dimension

C Syntax

#include "gpu/mxGPUArray.h"
void mxGPUSetDimensions(mxGPUArray * const mgp, mwSize const * const dims, mwSize const ndims);



Pointer to an mxGPUArray


Dimensions array. Each element in the dimensions array contains the size of the array in that dimension. For example, in C, setting dims[0] to 5 and dims[1] to 7 establishes a 5-by-7 mxGPUArray.

The dims array must not increase the overall size of the mxGPUArray. This array must contain at least ndims elements.


Number of dimensions.


Call mxGPUSetDimensions to reshape an existing mxGPUArray. mxGPUSetDimensions does not reallocate memory.

Introduced in R2018b