Q:

Create a matrix variable mat. Find as many expressions as you can that would refer to the last element in the matrix, without assuming that you know how many elements or rows or columns it has (i.e., make your expressions general)

0

Create a matrix variable mat. Find as many expressions as you can that would refer to the last element in the matrix, without assuming that you know how many elements or rows or columns it has (i.e., make your expressions general).

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

>> mat = [12:15; 6:-1:3]

mat =

 12 13 14 15

 6 5 4 3

>> mat(end,end)

ans =

 3

>> mat(end)

ans =

 3

>> [r c] = size(mat);

>> mat(r,c)

ans =

 3

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now