Problem 60852. Zero Out Negative Elements

Write a MATLAB function called zeroNegatives that takes a numeric vector v as input and returns a modified version where all negative elements are replaced with 0, while keeping all non-negative elements unchanged.

Solution Stats

76.19% Correct | 23.81% Incorrect
Last Solution submitted on Sep 17, 2025

Problem Comments

Solution Comments

Show comments

Problem Recent Solvers16

Suggested Problems

Problem Tags

Community Treasure Hunt

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

Start Hunting!