Textbooks.elsevier.com - tools for all your teaching needs.

A dimension can also be specified when calling these functions. MATLAB refers to the columns as dimension 1 and the rows as dimension 2, such as the following: >> sum(mat,1) >> sum(mat,2) Create a matrix and find the product of each row and column using prod. >> mat = randi([1, 30], 2,3) mat = 11 24 16. 5 10 5 >> prod(mat) ans = 55 240 80 ................
................