Info

This question is closed. Reopen it to edit or answer.

what does it mean by [ ] in the following code

4 views (last 30 days)
sagar sarwar
sagar sarwar on 30 Dec 2017
Closed: MATLAB Answer Bot on 20 Aug 2021
min(N,[],3)

Answers (2)

ANKUR KUMAR
ANKUR KUMAR on 30 Dec 2017
Edited: ANKUR KUMAR on 30 Dec 2017
It returns a column vector containing the smallest element in each row along third dimension.

Star Strider
Star Strider on 30 Dec 2017
In the min function, the second argument is usually the second numerical scalar value to be compared. If you only have one argument, for example a matrix, and you want to find the minimum in a specific dimension of the matrix, leave the second argument ‘empty’ with the ‘empty array’ denoted by [], and then use a dimension argument.
In a function call, all arguments must appear in the correct order.
So here:
min(N,[],3)
the function takes the minimum of matrix ‘N’ along the third dimension, leaving the second argument ‘empty’.

This question is closed.

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!