Hello. I have a error about matrix dimensions and below is the code
clear alln = 1100;x = [randn(300, 1); randn(500, 1)+8.0; randn(300, 1)+12.0];m = 3;mu = linspace(min(x), max(x), m)';tmp1 = (repmat(x, [m 1]) - repmat(mu, [1 n])).^2;
I have no idea about why this error is occurred because the size of matrix must be same. The error occurs in the final line.(tmp1=blah) How to fix it?
Best Answer