I have matrix size (1508 x 19).
I want to do subtraction between rows like Row 1 - Row 2, Row 1 - Row 4, Row 1 - Row 6, Row 1 - Row 8, Row 1 - Row 10, Row 1 - Row 12, Row 1 - Row 14,
Row 1 - Row 16, Row 1 - Row 18.
without changing the size of a matrix and remainng rows like (row 1, 3, 5, 7, 9, 11, 13, 15, 17, 19) stay same in matrix.
Can some one help me please
Thank you in advance...

댓글 수: 1

João Mendes
João Mendes 2020년 10월 14일
So what do you want as a result?
A matrix where the first row is row1-row2? The second one row1-row4? and so on?
What is your final goal?

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

 채택된 답변

Asad (Mehrzad) Khoddam
Asad (Mehrzad) Khoddam 2020년 10월 14일

0 개 추천

a(2:2:end,:) = a(1,:)-a(2:2:end,:);

댓글 수: 3

Vivek Shukla
Vivek Shukla 2020년 10월 14일
Can you help me more in this case?
I have matrix size (1508 x 19).
I want to do subtraction between rows like Row 3 - Row 5, Row 3 - Row 7, Row 3 - Row 9, Row 3 - Row 11, Row 3 - Row 13, Row 3 - Row 15, Row 3 - Row 17, Row 3 - Row 19.
without changing the size of a matrix and remainng rows like (row 1, 2, 3, 4, 6, 8, 10, 12, 14, 16, 18) stay same in matrix.
Can some one help me please
Thank you in advance...
a(5:2:end,:) = a(3,:)-a(5:2:end,:);
Vivek Shukla
Vivek Shukla 2020년 10월 15일
thank you

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

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Resizing and Reshaping Matrices에 대해 자세히 알아보기

제품

릴리스

R2018a

질문:

2020년 10월 14일

댓글:

2020년 10월 15일

Community Treasure Hunt

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

Start Hunting!

Translated by