Info
This question is closed. Reopen it to edit or answer.
sir, i generate the list of cluster-heads and corresponding there energy but now i want to extract the energy with corresponding cluster-id according to lower energy cluster-heads, medium energy cluster-heads,higher energy groups, how do it..?
1 view (last 30 days)
Show older comments
Ex- CH-ID ENERGY 12 1.2J 14 5.5 25 2.5J here the extract the energy by threshold like all the energy group, while(energy<=2.6) but it not give the corresponding ID .
0 Comments
Answers (1)
KSSV
on 15 Mar 2018
E = [ 12 1.2 14 5.5 25 2.5] ;
idx = E<2.6 ;
The above gives logical indices where energy is less then 2.6. If you want the indices use find .
idx = find(E<2.6) ;
But it suggested and better to use logical indexing rather then find.
0 Comments
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!