How to process a subset of a matrix

조회 수: 3 (최근 30일)
Mohsin Shah
Mohsin Shah 2018년 4월 13일
편집: David Fletcher 2018년 4월 13일
I have a nxm matrix and I want to divide the first R rows by a certain number. For example,
2 4 6 8
10 12 14 16
1 3 5 7
6 7 13 9
I want to divide the first two rows by 2 to get the modified matrix as
1 2 3 4
5 6 7 8
1 3 5 7
6 7 13 9
I know its simple but how to do it?

채택된 답변

David Fletcher
David Fletcher 2018년 4월 13일
편집: David Fletcher 2018년 4월 13일
matrixName(2,:)=matrixName(2,:)/2

추가 답변 (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