MATLAB: A Problem with log10

log10MATLABmatrix array

Dear all
I just began to work w Matlab. I have an array with decimal numbers and zeros from which I have to calculate log10 and write a new array, but it doesn't work. When i run this i got error "Attempted to access log10(0.946491); index must be a positive integer or logical." code is as follows
log10=zeros(2030,1354);
for j=1:1354
for i=1:2030
log10(i,j)=R547(i,j)/R531(i,j);
end
end
log10(isnan(log10)) = 0 ; %my array
>> for j=1:1354
for i=1:2030
if log10(i,j)~=0
X(i,j)=log10(double(log10(i,j)));
end
end
end
Anyone please help me
Thank you

Best Answer

You overwrite Matlabs log10 function with your log10 matrix; rename it and everything should work fine.
Related Question