how to use function "find" over matrices
Show older comments
Suppose x = rand(1e5,1e5);
I want to find the lowest number in each column of x without using for loop.
Is it possible?
Accepted Answer
More Answers (1)
David Hill
on 9 Apr 2020
min(x);
3 Comments
parham kianian
on 9 Apr 2020
Edited: parham kianian
on 9 Apr 2020
David Hill
on 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
on 10 Apr 2020
Categories
Find more on Creating and Concatenating Matrices 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!