フィルターのクリア

i want to create a array structure using one,zero,eye

2 ビュー (過去 30 日間)
ajay kumar
ajay kumar 2016 年 2 月 2 日
コメント済み: ajay kumar 2016 年 2 月 2 日
use the ones, zeroes, eye and addressing commands as appropriate to construct the matrix D, by using upto three lines of command.
3 0 0 2 2
0 3 0 2 2
0 0 3 0 0
Thanks in advance

採用された回答

Moe_2015
Moe_2015 2016 年 2 月 2 日
D=[3*eye(3),[2*ones(2);zeros(1,2)]]
You can do it in one line as seen here.

その他の回答 (0 件)

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by