Provided is an m-by-n integer data matrix A whose elements are drawn arbitrarily from a set S = [1,2,3,...,S] for any large integer number S > 1. The "arbitrary" manner of drawing integer numbers implies that each column of A might contain only a subset of integer numbers from S. Our objective is to regularize the data in A subject to the following rules:
For each column in A,
For example, S = [1:8] with S = 8. Suppose the input data matrix A is
A = [2 6 5 3 5 6 3 7]
Then the output matrix B is
B = [1 2 3 1 3 2 2 3]
Please try to avoid for or while loops. Vectorized code will be more appreciated.
129 Solvers
Duplicate each element of a vector.
465 Solvers
Find the index of the largest value in any vector X=[4,3,4,5,9,12,0,4.....5]
236 Solvers
Decimation - Optimized for speed
67 Solvers
Write a function man that takes a row vector v and returns a matrix H as follows..
243 Solvers