how to create a binary random matrix

1 次查看(过去 30 天)
hi, i want to create a binary random matrix of (4,2). matrix row could be: 0 0 or 0 1 or 1 0 or 1 1. how can i do that please. thanks

回答(1 个)

Azzi Abdelmalek
Azzi Abdelmalek 2016-5-5
randi([0 1],4,2)

类别

Help CenterFile Exchange 中查找有关 Creating and Concatenating Matrices 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by