How to make values in a matrix from 0 to a certain number?

1 vue (au cours des 30 derniers jours)
Ray
Ray le 19 Oct 2014
Réponse apportée : Matt J le 19 Oct 2014
I have a function [new] = lower(old, max) where old is a 3x3 matrix and new is a 3x3 matrix whose values do not go above max, which is just a number. new is derived from old, needless to say. My question is, how do I make it so the elements in the matrix do not go above max. I have to vectorize this function (so no selection or iteration).

Réponse acceptée

Matt J
Matt J le 19 Oct 2014
You are simply re-inventing the min() command
new=min(old, threshold)

Plus de réponses (0)

Catégories

En savoir plus sur Signal Generation and Preprocessing 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