I have a problem with data type in MATLAB. It's a simple code of converting binary to decimal. For my further task, those should be integer 64 bit. How can I do it?
This code converts those value into double. And, type casting isn't helpful; for example, for the first value, sum is 4.0265e+09 but after casting via Y = typecast(sum, 'int64'); it generates 4750734656922451968 which is not correct value.
example.png:
I = imread('example.png');
level = graythresh(I);
img = im2bw(I,level);
sz=size(img);
for i=1:sz(1)
sum=0;
p=1;
for j=sz(2):-1:1
sum=sum+img(i,j)*p;
p=p*2;
end
disp(sum);
end

sumas the name of your variable; that's a built-in MATLAB function. - Benoit_11