i am executing the code given in the matlab documentation and getting the error'Undefined function 'psnr' for input arguments of type 'double'.
조회 수: 2 (최근 30일)
이전 댓글 표시
is psnr is not inbuilt in matlab?
ref = imread('lena256.bmp');
ref=double(ref(:,:,1));
A = imnoise(ref,'salt & pepper', 0.02);
%Calculate the PSNR.
[peaksnr, snr] = psnr(A, ref);
fprintf('\n The Peak-SNR value is %0.4f', peaksnr);
fprintf('\n The SNR value is %0.4f \n', snr);
댓글 수: 0
답변 (1개)
Meghana Dinesh
2015년 3월 16일
편집: Meghana Dinesh
2015년 3월 16일
As far as I know, only A should be of type double. Also, check if you have the necessary toolbox and the right version of MATLAB where psnr is included.
Regards,
Meghana.
댓글 수: 0
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!