find all elements that can be devided with 5

i need to write function that takes one matrix and find all elements can be devided with 5 and replaces them with 5. in c++ for this problem you can write something like this if(a%5==0) a=5 thanks in advance

 채택된 답변

Adam
Adam 2014년 11월 17일

1 개 추천

a( rem(a,5) == 0 ) = 5;

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Introduction to Installation and Licensing에 대해 자세히 알아보기

태그

질문:

2014년 11월 17일

댓글:

2014년 11월 17일

Community Treasure Hunt

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

Start Hunting!

Translated by