How to find multiple minimum values in larger arrays?
Show older comments
I work with larger arrays (100x100) and am trying to develop a script which finds minimum values in the array, 10 units smaller than the surrounding 6-8 grid points. For example in the followig array it would be the '15' and the '18'
30 30 30 29 30
30 30 30 15 20
30 30 30 30 30
30 18 30 30 30
30 30 30 30 30
Thing I am trying to achieve from the script:
- something which identifies minima in the array (10 units smaller than surrounding 6-8 grid points)
- a script which displays the location of where these minima are in the command window
My attempt at script was this (it doesn't run, doesn't display the location of the minima, but hopefully gives you an indication of what I'm looking for:
A=[25,26,25,25,26;27,25,25,23,23;25,26,22,4,20;25,25,25,20,25;26,26,25,...
25,26;25,25,25,26,25;24,25,24,25,26]
contourf(A,10,'LineColor','none')
%
for i=1:6; j=1:6;
if A(i,:)<=A(i+1,:)&& A(j,:)<=A(j+1,:)
disp(‘minima Present')
end
end
Any help with any part of the script would be greatly appreciated. Thanks :)
Accepted Answer
More Answers (0)
Categories
Find more on Logical 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!