MATLAB: Finding row indexes in array

I have an array
a=[0 0 1 0 ; 1 2 3 0; 1 0 3 4; 0 2 0 0 ]
& cell array like
b{1,1}=[4;3]
b{2,1}=[3;1;4]
I want to find elements of cell array in a. For example: for b{2,1} 1st, 3rd and 4th row of a should be displayed and 2nd should be zero.
Thanks in advance

Best Answer

a=[0 0 1 0 ; 1 2 3 0; 1 0 3 4; 0 2 0 0 ];
b{1,1}=[4;3];
b{2,1}=[3;1;4];
v = 1:size(a,1);
t = cell2mat(cellfun(@(x)ismember(v,x),b,'un',0))';
out = a.*permute(t,[1,3,2]);