How does MATLAB 'fill in' elements when subsetting a matrix by vectors?
Show older comments
A = [1, 2, 3;
4, 5, 6;
7, 8, 9];
B = A([end, 1:end], [end, 1:end])
% B =
%
% 9 7 8 9
% 3 1 2 3
% 6 4 5 6
% 9 7 8 9
Why is the first element of matrix B, i.e. B(1,1), 9?
All the other elements seem to follow the 'classic' rules of concatination/subsetting but how does MATLAB 'fill in' element (1,1)?
Accepted Answer
More Answers (0)
Categories
Find more on Matrix Indexing in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!