Matrix(Matrix)
Show older comments
I am a new MATLAB user and am unsure of what operation is being carried out by the below chunk of code.
a=[1 1;1 2]
b=[1;0;0;1]
b(a(:),:)
ans =
1
1
1
0
a(:)
^obviously gives the column vector of a.
(a(:),:)
^selects all rows and columns in this column vector.
b(a(:),:)
^what does this chunk of code do?
Accepted Answer
More Answers (1)
nada zaidi
on 6 Apr 2021
0 votes
B=A(2 -3 2 -4)
Categories
Find more on Creating and Concatenating Matrices 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!