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)
belongs to book: MATLAB: A Practical Introduction to Programming and Problem Solving|Stormy Attaway|Fourth Edition| Chapter number:2| Question number:19.2
All Answers
total answers (1)
>> 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