Effacer les filtres
Effacer les filtres

find values

1 vue (au cours des 30 derniers jours)
ricco
ricco le 17 Nov 2011
If I have a matrix where each column refers to depth and each row refers to days, how is it possible to find and keep the values in each column which is between 0 and 30. At the minute some of the values fall below 0 and others reach as high as 100. So how would I just keep the values between 0 and 30 in the same matrix and make every other value as NaN?
cheers

Réponse acceptée

Wayne King
Wayne King le 17 Nov 2011
X = randi([-5 110],10,10);
X(X<0 | X>30) = NaN;
  3 commentaires
Wayne King
Wayne King le 17 Nov 2011
@Mitch Martelli R2008b
Mitch Martelli
Mitch Martelli le 17 Nov 2011
Thanks a lot...you are very kind

Connectez-vous pour commenter.

Plus de réponses (0)

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by