Eye command with a matrix

조회 수: 6 (최근 30일)
marie
marie 2013년 2월 20일
Use the eye command to create the array A shown on the left below. Then use the
colon to address elements in the arrays and the eye command to change A to match the array
shown on the right.
So far I have tried
A=eye(7,7)
A=[2,2,2,0,5,5,5;2,2,2,0,5,5,5;3,3,3,0,5,5,5;0,0,0,1,0,0,0;4,4,7,0,9,9,9;4,4,7,0,9,9,9;4,4,7,0,9,9,9]
to match the array i did
B=[A eye(7,0)]
  댓글 수: 7
Santosh
Santosh 2013년 2월 20일
colon is a vectorization operator whose usage is m:n. :3 here is not correct.
marie
marie 2013년 2월 20일
I got it thank you!

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Design of Experiments (DOE)에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by