Receive Error using / Arguments must be numeric, char, or logical when I am using histogram
3 views (last 30 days)
Show older comments
I am working on dicom file. I Get Error using / Arguments must be numeric, char, or logical error when histogram lines are working. Help me please
(h1 = histogram(a, 64)/n;
h2 = histogram(b,64)/n;)
[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, 64)/n;
h2 = histogram(b,64)/n;
s = zeros(32768,32768);
H = H/n;
for i = 1: 64
for j = 1:128
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
0 Comments
Accepted Answer
More Answers (0)
See Also
Categories
Find more on Histograms in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!