Undefined function 'mtimes' for input arguments of type 'matlab.gr​aphics.cha​rt.primiti​ve.Histogr​am'.

조회 수: 4 (최근 30일)
My code gives error in last line, I could not find why,
Please help me!
Undefined function 'mtimes' for input arguments of type 'matlab.graphics.chart.primitive.Histogram'.
Error in a_mutual_information_64 (line 32)
s(i,j)= H(i,j)*(log2(H(i,j)/(h1(i)*h2(j))));
[Org, map1] = dicomread("ad-talarich\a4\ADNI_131_S_0497_PT_Talairach_Warped_Br_20080307132607768_3_S15907_I95832.dcm")
[Ref, map2] = dicomread('cn-talararich\a97\ADNI_005_S_0610_PT_Talairach_Warped_Br_20080306090318595_2_S17355_I95406.dcm')
a = double(Org);
b = double(Ref);
%a = Org(:);
%b = Ref(:);
n = length(a);
H = zeros(25600,25600);
for i = 1:n
x = a(i);
y = b(i);
H(x+1,y+1) = H(x+1,y+1) + 1 ;
end
h1 = histogram(a/n);
h2 = histogram(b/n);
s = zeros(64,64);
H = H/n;
for i = 1: 64
for j = 1:64
if H(i,j) == 0 || h1(i) == 0 || h2(j) == 0
s(i,j) = 0;
else
s(i,j)= H(i,j)*(log2(H(i,j)/(h1(i)*h2(j))));
end
end
end

채택된 답변

Voss
Voss 2021년 12월 20일
Right now, h1 and h2 are Histogram objects, and it doesn't make sense to multiply two histogram objects. This is what the error message is saying.
  댓글 수: 3

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Special Functions에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by