Eren Golge
Eren Golge

Reputation: 790

Apply conditional operation to each element of a vector in MATLAB

I have a vector such V = [0.5,0.6,0.2,0.8...] and I want to map each element to its nearest integer 0 or 1.

What is the function or method to do so?

Upvotes: 0

Views: 159

Answers (1)

Eren Golge
Eren Golge

Reputation: 790

round() is doing that :) is it obvious, silly me !

Upvotes: 1

Related Questions