필터 지우기
필터 지우기

substract row of an array by a vector

조회 수: 1 (최근 30일)
Cedrick De Block
Cedrick De Block 2021년 7월 13일
댓글: Stephen23 2021년 7월 13일
Hi,
I have an array of 63X2 and I want to substract the values of the 18, 36 and 54 of the first colum with 2 and then to addition the values of the 18, 36 and of the second colum with 2.
can someone help me with this please!!
Thank you in advance!!

채택된 답변

Stephen23
Stephen23 2021년 7월 13일
Where A is your array:
X = [18,36,54];
A(X,1) = A(X,1) - 2;
A(X,2) = A(X,2) + 2;
  댓글 수: 2
Cedrick De Block
Cedrick De Block 2021년 7월 13일
Thank you very much, it works!!
Stephen23
Stephen23 2021년 7월 13일
@Cedrick De Block: please accept my answer if it helped you!

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

추가 답변 (0개)

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by