For a vector x and number n, the goal is to find every element of x inferior to n and replace it by n.
Example
x= [ 1 2 3 4 5 1 2 4 6]
n=3
y_correct= [ 3 3 3 4 5 3 3 4 6]
Solution Stats
Problem Comments
1 Comment
Solution Comments
Show comments
Loading...
Problem Recent Solvers155
Suggested Problems
-
6977 Solvers
-
We love vectorized solutions. Problem 1 : remove the row average.
884 Solvers
-
Sum of diagonals elements of a matrix
231 Solvers
-
Matlab Basics - Set unwanted parts of a vector to zero
261 Solvers
-
Matlab Basics - y as a function of x
527 Solvers
More from this Author1
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
Thanks for adding the third test case. It is very interesting (still working on passing)