Filtering Data between two user inputted Values
13 views (last 30 days)
Show older comments
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'))
0 Comments
Answers (1)
Ameer Hamza
on 1 Apr 2020
Edited: Ameer Hamza
on 1 Apr 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
0 Comments
See Also
Categories
Find more on Resizing and Reshaping Matrices in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!