Error using * MTIMES is not fully supported for integer classes. At least one input must be scalar
이전 댓글 표시
I m traying to create an NMF algorithm (the multiplicative update rules) to decompose an image ento 2 matrix, but a message error apperas "Error using * MTIMES is not fully supported for integer classes. At least one input must be scalar" at line 5 . could u plz help me
V=imread('circuit.tif');
[m,n]= size(V);
for iter=1:Niter;
for W0 = rand (m,r);
H0 = h0.* (V*w0')./((w0'*w0)*h0 + (10^-9));
gradW = W*(H*H') - V*H';
gradH = (W'*W)*H - W'*V;
end
for h0=rand(r,n);
w0= w.*(V*h0')./(w0*h0*h0'+10^-9);
gradW = W*(H*H') - V*H';
gradH = (W'*W)*H - W'*V;
end
projnorm = ([norm(gradW(gradW<0 | W>0)); norm(gradH(gradH<0 | H>0))]);
if projnorm < tol*initgrad | iter == Niter | cputime-initt > timelimit,
fprintf('Iter = %d Final proj-grad norm %f\n', iter, projnorm);
break
end
W = W.*(V*H')./(W*(H*H'));
H = H.*(W'*V)./((W'*W)*H);
end
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Statistics and Machine Learning Toolbox에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!