I have two matrices, one with 1x153 double and the other with 153x512 double and I require to subtract them while it is not possible and gives me error that they have not same dimensions.
Any idea how to solve it plz?
I have two matrices, one with 1x153 double and the other with 153x512 double and I require to subtract them while it is not possible and gives me error that they have not same dimensions.
Any idea how to solve it plz?
Use bsxfun:
A = rand(1,153);
B = rand(153,152);
bsxfun(@minus,A.', B);
Notice that I first transposed A
as one dimension needs to match at least.