How to replace zero with a number in null matrix at required position

조회 수: 2 (최근 30일)
kamal
kamal 2019년 6월 19일
댓글: kamal 2019년 6월 19일
A simple case like this
1.PNG
I want to replace the some elements with other numbers like this
2.PNG

채택된 답변

Raj
Raj 2019년 6월 19일
I see no specific pattern in your modified matrix. So just use proper indexing to insert the required number at required location.
A=zeros(5)
A(1,5)=7
A(2,2)=8
A(3,5)=2
A(4,2)=4
A(5,3)=1
Its quite trivial so I am not sure if this is what you are looking for.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Title에 대해 자세히 알아보기

제품


릴리스

R2014b

Community Treasure Hunt

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

Start Hunting!

Translated by