How to create a matrix with ones and zeros in one line?
Show older comments

I am trying to build these matrices but we can only use one operator. Any help on how to build these with one operator would be great.
Answers (1)
Image Analyst
on 11 Jan 2021
Did you use the equals sign, which is the assignment operator?
m19 = [1,0,0,1,1;
0,1,0,1,1];
m20 = [0,0,1,1;
0,0,1,1
0,0,0,0
1,1,1,1]
1 Comment
Danny Orsic
on 11 Jan 2021
Categories
Find more on Arithmetic Operations in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!