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;

1 件のコメント

Etan Cole
Etan Cole 2014 年 11 月 17 日
thanks man very fast you have been of much help.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeIntroduction 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