MATLAB: How can i get specific rows of a matrix without using loops

no loopsrows

My question is, how can I get matrix c in an efficient way?(no loops)
c represents the rows of a, given b.
a=[10 14 12 15
12 11 12 18
11 14 28 15
18 11 15 18
20 11 45 85]
b=[1
4
2]
c=[10 14 12 15
18 11 15 18
12 12 12 18]
Thank you in advance

Best Answer

c = a(b,:);