Setting a limit in an array
13 views (last 30 days)
Show older comments
Commented: Chris Brown on 8 Feb 2017
I am trying to set a limit for values within an array between a set of point. I have a 3D array - say 100x100x100.
I want to set a limit of 30, so if the values are lower they become 30. I also only want to apply the values between 40 and 50 in the z axis... I have tried a few methods, but can't seem to get it to work. Any help would be appreciated.
This is what I have tried so far..
and separately -
Alexandra Harkai on 8 Feb 2017
Given initial matrix F, this will floor entries at 30 in between z 'axis' (from and including) 40 and 50:
F(:,:,40:50) = max( 30, F(:,:,40:50) );
More Answers (0)
Find more on Multidimensional Arrays 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!