Filtering Data between two user inputted Values

13 visualizaciones (últimos 30 días)
William Harris
William Harris el 1 de Abr. de 2020
Editada: Ameer Hamza el 1 de Abr. de 2020
I have 22483 % 6 x 3 Matrix, I am trying to filter this data between two user inputted values using the prompt 'inputdlg'. I want this to create a new column matrix which i can then plot. At the moment the Find operation isnt working, it either returns an error or just outputs the same values without any filtering.
prompt = {'Enter Eastings Upper Bound:','Enter Easting Lower Bound:','Enter Northings Upper Bound:','Enter Northings Lower Bound:'};
dlgtitle = 'Input must be within array dimensions';
dims = [1 35];
definput = {'300000','inf','0','inf'};
bounds = inputdlg(prompt,dlgtitle,dims,definput);
%bounds prompt
Users_Input=str2double(bounds)
%converting bounds into matrix
Eastings_Upper_Bound=Users_Input(1,:);
Eastings_Lower_Bound=Users_Input(2,:);
Northings_Upper_Bound=Users_Input(3,:);
Nothings_Lower_Bound=Users_Input(4,:);
find(Easting_Data(Easting_Data>'Eastings_Lower_Bound' & Easting_Data<'Eastings_Upper_Bound'))

Respuestas (1)

Ameer Hamza
Ameer Hamza el 1 de Abr. de 2020
Editada: Ameer Hamza el 1 de Abr. de 2020
You are referring to variable names as character array. Correct is
find(Easting_Data(Easting_Data>Eastings_Lower_Bound & Easting_Data<Eastings_Upper_Bound))
% ^ no ' ' here

Categorías

Más información sobre Resizing and Reshaping Matrices en Help Center y File Exchange.

Etiquetas

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by