How to separate a data in this way?

1 view (last 30 days)
Yunseo Choi
Yunseo Choi on 7 Aug 2018
Commented: KSSV on 7 Aug 2018
For example, if I have a data like this
what I want is - if I look at the first column,
since 0<(1,1)=0.9370 = print a=1, b=1 and 2<(2,1),(3,1)<3 = >print a=2, b=3
....
like this so that I can get a matrix of
A= coordinate(a:b,:)
How can I do this?

Accepted Answer

KSSV
KSSV on 7 Aug 2018
Let C be you column in which you want to seek the indices.
idx = C<1 ; % this is logical indesing, this gives numbers in C less than 1
idx = find(C) ; % this gives you the location you want.
  2 Comments
Yunseo Choi
Yunseo Choi on 7 Aug 2018
Then How can I get a A = coordinate(a:b,:) of every data as using for and if statement same as above condition?
KSSV
KSSV on 7 Aug 2018
[A,txt,raw] = xlsread('coordinate.xlsx') ; % read file
iwant = A(A(:,1)<12,:) % This gives the data for first column less then 12

Sign in to comment.

More Answers (0)

Categories

Find more on Matrices and Arrays in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!