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

조회 수: 1 (최근 30일)
Ray
Ray 2014년 10월 19일
답변: Matt J 2014년 10월 19일
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).

채택된 답변

Matt J
Matt J 2014년 10월 19일
You are simply re-inventing the min() command
new=min(old, threshold)

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Signal Generation and Preprocessing에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by