hi, I have a matrix A=[5 4 1 4;1 2 4 5; 4 5 5 1;1 1 2 2] and an array b=[1 4 5 2]. I want to find the row number of first occurrence of the array elements in related columns of the matrix as follows: output=[2,1,3,4]. "considering that my data is big and I want to do this without using any loop" Can anyone help? thank you
MATLAB: Finding row number of an array elements in related columns of a matrix
findmatrix
Related Question
- I want to traverse an array in an ‘inverse s’ order and store in a single row array is there any matlab function or code for this?eg[1 2 3; 3 4 5; 4 5 1] becomes [1,2,3,5,4,3,4,5,1]
- Finding a row in matrix
- What is command for circularly writing a row matrix in matlab
- How to display in one variable the max of each one of two arrays
- Given a=[1 2 3 4 5], generate m=[2 1 3 4 5; 2 3 1 4 5; 2 3 4 1 5; 2 3 4 5 1; 1 3 2 4 5; 1 3 4 2 5; 1 3 4 5 2; 1 2 4 3 5; 1 2 4 5 3; 1 2 3 5 4].
- I have a matrix and I am actually interested in obtaining a vector that will consist of the first column in each row that has values lower certain value.
- Sum columns of matrix
- How to find component of a max value
Best Answer