putting a threshold into array values
14 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
M
am 5 Jun. 2021
Bearbeitet: SALAH ALRABEEI
am 5 Jun. 2021
I have an array like this:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/642910/image.png)
and I would like to create a function that as an output would return smaller array, with a given threshold for 2nd column so for example I could put threshold 0.1, and based on this screenshot as I return I'd have:
result = [15 0.2249; 49 0.1674; 50 0.5343]
P.S I wouldn't mind to change format into table,
thanks in advance
0 Kommentare
Akzeptierte Antwort
SALAH ALRABEEI
am 5 Jun. 2021
Bearbeitet: SALAH ALRABEEI
am 5 Jun. 2021
Assume your matrix is A, and b is the threshold
% code
B= A(A(:,2)>b,:);
0 Kommentare
Weitere Antworten (1)
Sulaymon Eshkabilov
am 5 Jun. 2021
Use this logical indexing operation:
OUT = result_Hygepdf((result_Hygepdf(:,2)>0.1), 2);
0 Kommentare
Siehe auch
Kategorien
Mehr zu Matrix Indexing finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!