MATLAB: How top solve error “Subscript indices must either be real positive integers or logicals.”

Image Processing Toolboxsubscript indices must either be real positive integers or logicals. getting this error for psnr() function.

I am getting this error while using psnr() function to find signal to noise ratio. Plz help me to get out of this. I called function like:psnr=psnr(one,two). Both are uint8 images.

Best Answer

psnr() is a built in function. So you can't assign it to itself. Pick another output return variable name, like thisPsnr
thisPsnr = psnr(one, two);
Related Question