필터 지우기
필터 지우기

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 CenterFile Exchange에서 Logical에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by