Filtering Data between two user inputted Values
12 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
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 Kommentare
Antworten (1)
Ameer Hamza
am 1 Apr. 2020
Bearbeitet: Ameer Hamza
am 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 Kommentare
Siehe auch
Kategorien
Mehr zu Resizing and Reshaping Matrices finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!