Replace elements in binary matrix

I have a binary image and want to replace all the zeroes with 1s and all the 1s with zeroes. ( so that the binary image is totally opposite to original image). How can i do that?

 采纳的回答

Michal
Michal 2019-6-29
编辑:Michal 2019-6-29
% B original binary matrix
% B_ new binary matrix
B_ = ~B;

类别

帮助中心File Exchange 中查找有关 Convert Image Type 的更多信息

产品

版本

R2018b

标签

Community Treasure Hunt

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

Start Hunting!

Translated by