how to use function "find" over matrices
Ältere Kommentare anzeigen
Suppose x = rand(1e5,1e5);
I want to find the lowest number in each column of x without using for loop.
Is it possible?
Akzeptierte Antwort
Weitere Antworten (1)
David Hill
am 9 Apr. 2020
min(x);
3 Kommentare
parham kianian
am 9 Apr. 2020
Bearbeitet: parham kianian
am 9 Apr. 2020
David Hill
am 10 Apr. 2020
x = rand(1e4);
a = x.*(x>.2&x<.25);
b=arrayfun(@(y)a(find(a(:,y),1),y),1:size(a,2));
parham kianian
am 10 Apr. 2020
Kategorien
Mehr zu Creating and Concatenating Matrices finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!