Finding maximum value, discounting a certain matrix place.

12 vues (au cours des 30 derniers jours)
Ulrik Nash
Ulrik Nash le 15 Juin 2011
Hi Everyone,
Suppose I have a 1,m matrix, which I call sweep.
Suppose also, that I have identified I to be a relevant place in sweep.
What I wish to achieve is the following, except in search of the maximum value, the expression should not include the place I:
val = max(nonzeros(sweep));
How can I amend the above, to discount the place I?
Regards,
Ulrik.

Réponses (2)

Sean de Wolski
Sean de Wolski le 15 Juin 2011
sweep2(ll) = []; %ll instead to make it more readable
val = max(nonzeros(sweep2));

Andrei Bobrov
Andrei Bobrov le 15 Juin 2011
sweep(I) = NaN

Catégories

En savoir plus sur Creating and Concatenating Matrices dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by