필터 지우기
필터 지우기

How do I replace elements of matrix which are greater than 9 with value 9 without using for loop?

조회 수: 2 (최근 30일)
I am working on an optimization problem. To make it run faster I need to do calculation inside defined function using matrices and not using foor loops. In that context I have this problem where a row matrix elements need to replaced by 9 if it is greater than 9. Can this be done using some matrix notation or I have to use for loop.
Thanks

채택된 답변

Walter Roberson
Walter Roberson 2021년 10월 1일
min(9,TheMatrix)

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Multidimensional Arrays에 대해 자세히 알아보기

제품


릴리스

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by