compare - Comparing elements of matrix of different Sizes dimension in Matlab -
can me find out method compare elements of different sized matrix in matlab ?
i have 1 matrix a (100×10) random elements.
the second array has of elements in matrix b (1×10) random elements.
let's element of matrix a(i,j) , b(i,j) element of b.
so want compare b(i_1,j_1) equal a(i_1,j_1; i_2,j_1; i_3,j_1;.....; i_100_j_1) in these 2 matrices, i.e, need compare first row, first column of matrix b , row, first column of matrix a.
if equal - 1, if not equal - 0. , new matrix c.
the elements numbers not strings.
what function can use in case if wanna again compare , b1 (like b) 10x1 matrix ? perhaps add b2, b3..and on. plz me.
regards, kyaw kyaw
sounds case bsxfun:
c = bsxfun(@eq, a,b);
Comments
Post a Comment