Filtering Data between two user inputted Values

13 次查看(过去 30 天)
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'))

回答(1 个)

Ameer Hamza
Ameer Hamza 2020-4-1
编辑:Ameer Hamza 2020-4-1
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

类别

Help CenterFile Exchange 中查找有关 Resizing and Reshaping Matrices 的更多信息

标签

产品

Community Treasure Hunt

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

Start Hunting!

Translated by