MATLAB Answers

0

How to process a subset of a matrix

Asked by Mohsin Shah on 13 Apr 2018
Latest activity Edited by David Fletcher on 13 Apr 2018
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?

  0 Comments

Sign in to comment.

1 Answer

Answer by David Fletcher on 13 Apr 2018
Edited by David Fletcher on 13 Apr 2018
 Accepted Answer

matrixName(2,:)=matrixName(2,:)/2

  0 Comments

Sign in to comment.