## How to find duplicate elements in 2D array?

My code completes an 2D array that have random numbers from 0 to 9. The same number may appear several times in the same column, against the rules of a Sudoku game. I have the following filtering code, that it’s not working as I want:

**How to use find in a 3D matrix in MATLAB?**

Using find in a 3d matrix in MATLAB. to find my position for point 8. ‘find’ just works for 2D arrays .for the 3D case it doesnt work. is there is possibility for 3D arrays? Sign in to answer this question.

**How to create a multidimensional array in MATLAB?**

You can create a multidimensional array by creating a 2-D matrix first, and then extending it. For example, first define a 3-by-3 matrix as the first page in a 3-D array.

### How to find an element in a multidimensional array?

To access elements in a multidimensional array, use integer subscripts just as you would for vectors and matrices. For example, find the 1,2,2 element of A, which is in the first row, second column, and second page of A.

**How to create a 3D array in MATLAB?**

You almost have it correct. What you would need to do is first create a 3D matrix stack, then assign a 3D vector to the middle entry. Something like this would do: First pre-allocate a matrix F that is the identity matrix for all slices, then replace the middle row and middle column of each slice with i/10 for i = 1, 2., 50.

**How to find duplicate entries in an array of strings?**

I need to find the indexes of duplicate strings in this array. That is, the output I expect is an array of the indices of strings that appear two or more times in the cell array of strings. How can I do this? You can order the array, and then check for each cell if it equals the following cell.

Using find in a 3d matrix in MATLAB. to find my position for point 8. ‘find’ just works for 2D arrays .for the 3D case it doesnt work. is there is possibility for 3D arrays? Sign in to answer this question.

#### How to find the indices of duplicates in MATLAB?

If you want to look for consecutive repeats, call the diff () function and look for zeros. Sign in to comment. Sign in to comment. will give you the indices if you want them rather than a logical vector. There are probably neater methods though. should do the job. but MATLAB returns me this -> Error using unique Too many input arguments.