简体   繁体   中英

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?

round()正在这样做:)很明显,愚蠢的我!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM