MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn moreOpportunities for recent engineering grads.

Apply TodayInspired by problem http://www.mathworks.co.kr/matlabcentral/cody/problems/856-getting-the-indices-from-a-matrice Inputs: - matrix A, lower limit, upper limit Ouputs: - indices of matrix elements which are bigger than or equal to lower limit and smaller than upper limit

A little complication: let your function be able to deal with a random order of the input arguments.

If all input arguments have the same size, assume that the first argument is the "matrix" with value(s).

Don't use "find" and don't use "regexp".

13 correct solutions
18 incorrect solutions

Last solution submitted on Oct 26, 2014

1 player likes this solution

2 Comments

Marcel
on 8 Jan 2014

Nice solution, I overlooked the potential usage of ind2sub.

J.R.! Menzinger
on 9 Jan 2014

You should use 'varargin' here ;-)
take a look: http://www.mathworks.de/matlabcentral/cody/problems/2091-return-row-and-column-indices-given-2-values-which-define-a-range/solutions/382339

1 Comment