Out of Bounds Analysis of Array

2 visualizaciones (últimos 30 días)
Tessa Aus
Tessa Aus el 6 de Jul. de 2016
Respondida: Tessa Aus el 7 de Jul. de 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".

Respuesta aceptada

Tessa Aus
Tessa Aus el 7 de Jul. de 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');

Más respuestas (0)

Categorías

Más información sobre Operators and Elementary Operations en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by