Problem 43038. Odd times 3
Given a input matrix x, multiply all odd values by 3. Even values remain the same.
example:
x = [1 2 3 4 5;... 6 7 8 9 10];
then y should be:
y = [3 2 9 4 15;... 6 21 8 27 10];
Solution Stats
Solution Comments
Show commentsProblem Recent Solvers67
Suggested Problems
-
26246 Solvers
-
Replace multiples of 5 with NaN
432 Solvers
-
405 Solvers
-
344 Solvers
-
multiply an array by its position number
104 Solvers
More from this Author25
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!