
Next, let us take the example when our output variables are less than ndims (Y). Here also, we will use the same array as in the above exampleĪs we can see, the input has 3 size dimensions, but our output variables are only 2. To get size of the dimension, below is our code: Here, we are creating 2 arrays of size 4 x 3, with all ‘unity’ elements. Let us first define a different input array. To assign sizes of dimensions to separate variables, we can use below code:Īs we can observe in the output, we have got size for all dimensions in separate variables.

The function will return those present in the extra variable In case the number of arguments ‘n’ in output are not equal to ndims(Y), then if: n > ndims(Y) = size(Y), this function will return the size of ‘n’ dimensions of input array X in separate variables.A = size(Y,dim), this function will return the size of Y’s dimension, specified by the input scalar dim.



= size(Y), this function will return the size of input matrix in 2 separate variables ‘a’ and ‘b’.A = size(Y), this function will return the size of each dimension of the array passed as input.= size(Y) Description of Size Function in MATLAB Hadoop, Data Science, Statistics & others
