15 views (last 30 days)

madhan ravi
on 30 Jun 2020

That's equivalent to:

[A(1,1), A(1,end);...

A(1,end), A(end,end)]

https://www.mathworks.com/company/newsletters/articles/matrix-indexing-in-matlab.html - read above linear indexing.

RAVIKIRAN YALAMARTHI
on 30 Jun 2020

Simple example:

A = [1 2 3;4 5 6;7 8 9]

A([1,end],[1,end])

ans = 2 by 2

1 3

7 9

To call the elements in a matrix, we have to mention the row and column index values.

So, A(1,2) = 2. Since, 1st row and 2nd column element is 2.

similarly, A([1,end],[1,end]) will call the elements of,

1st row & 1st column: A(1,1)

last row & 1st column: A(end,1)

1st row & last column: A(1,end)

last row & last column: A(end,end)

Opportunities for recent engineering grads.

Apply Today
## 0 Comments

Sign in to comment.