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

4 ビュー (過去 30 日間)
Danny Orsic
Danny Orsic 2021 年 1 月 11 日
コメント済み: Danny Orsic 2021 年 1 月 11 日
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.

回答 (1 件)

Image Analyst
Image Analyst 2021 年 1 月 11 日
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 件のコメント
Danny Orsic
Danny Orsic 2021 年 1 月 11 日
We can't just type the numbers in we have to use operators like colon, linspace or transpose to name a few we are working with right now.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeMultidimensional Arrays についてさらに検索

製品


リリース

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by