필터 지우기
필터 지우기

how can I add a value to a particular cell in an array.

조회 수: 8 (최근 30일)
Bashir Yusuf Bichi
Bashir Yusuf Bichi 2017년 11월 6일
답변: KL 2017년 11월 6일
if [3,2,4,5;3,2,6,4;2,5,8,5] is array then we add we add 2 to the second row to become [2,3,2,5;3, 4,6,4;2,5,8,5]
  댓글 수: 1
Star Strider
Star Strider 2017년 11월 6일
Your examples do not match what you state you want to do.

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

채택된 답변

KL
KL 2017년 11월 6일
if A is your array,
>> A = [3,2,4,5;3,2,6,4;2,5,8,5]
A =
3 2 4 5
3 2 6 4
2 5 8 5
and if you want to add 2 to 2nd row, 2nd column,
A(2,2) = A(2,2)+2;
and then A becomes,
A =
3 2 4 5
3 4 6 4
2 5 8 5
is this what you mean?

추가 답변 (0개)

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by