Out of Bounds Analysis of Array

2 views (last 30 days)
Tessa Aus
Tessa Aus on 6 Jul 2016
Answered: Tessa Aus on 7 Jul 2016
I have two arrays that have been imported one of which is a double array of bounds inputed from the user called num which contains for example [32.2; 32;-80.68;-80], on the other hand I have a LatitudeColumn{} cell array of a a nX1 size( the size n can change dependent on which file the user selected). I would like take the values 32.2 and 32 and find all values inside the LatitudeColumn{} cell array in which are out of "bounds" and then save the total number of values of the bounds ex 32.2>x>32.0. "After analysis there are Xnumber out of bounds".

Accepted Answer

Tessa Aus
Tessa Aus on 7 Jul 2016
I discovered the answer to my own question, it was decided to store the two boundry points from the array and the use cellfun to implement the logic. Here is my code for future viewers if they have a similar question.
% code
Latmax = num(1,1);
Latmin = num(2,1);
OutOfRangeLat = cellfun(@(x) (x > Latmin) & (x < Latmax), LatitudeColumn, 'Uni',0);
NrOutOfRangeLat = sum('OutOfRangeLat');

More Answers (0)

Categories

Find more on Operators and Elementary Operations in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!