嗨,我收到下面所述的错误,我试图在 0 和 1 之间进行标准化。我得到的错误是:
columns =
6
??? Error using ==> minus
Matrix dimensions must agree.
Error in ==> Kmeans at 54
data = ((data-minData)./(maxData));
不知道我做错了什么?完整代码如下:
%% dimensionality reduction
columns = 6
[U,S,V]=svds(fulldata,columns);
%% randomly select dataset
rows = 1000;
columns = 6;
%# pick random rows
indX = randperm( size(fulldata,1) );
indX = indX(1:rows);
%# pick random columns
indY = randperm( size(fulldata,2) );
indY = indY(1:columns);
%# filter data
data = U(indX,indY);
%% apply normalization method to every cell
maxData = max(data);
minData = min(data);
data = ((data-minData)./(maxData));
数据集为 1000x6。