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

 Akzeptierte Antwort

Adam
Adam am 17 Nov. 2014

1 Stimme

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

Weitere Antworten (0)

Kategorien

Tags

Gefragt:

am 17 Nov. 2014

Kommentiert:

am 17 Nov. 2014

Community Treasure Hunt

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

Start Hunting!

Translated by