"Attempt to execute SCRIPT fft2 as a function" Don't know how to solve this mistake. fft2 is a function of matlab. Thanks!
3 次查看(过去 30 天)
显示 更早的评论
clc;clear;
datos = imread('/users/Desktop/arroz.png');
U = im2double(datos);
[N,M] = size(datos);
P = 2*N;
Q = 2*M;
K1 = [0.0509 0.1238 0.0509;0.1238 0.3012 0.1238;0.0509 0.1238 0.0509];
K2 = [0.4444 0.1111 0.4444;0.1111 -2.2222 0.1111; 0.4444 0.1111 0.4444];
h1 = conv2(U,K1,'same');
h2 = conv2(U,K2,'same');
figure;
subplot(1,2,1);imshow(h1,[]);title('Convolución con kernel K1');
subplot(1,2,2);imshow(h2,[]);title('Convolución con kernel K2');
ZP1 = zeros(P,Q);
ZP2 = zeros(P,Q);
ZP1(1:N,1:M) = h1;
ZP2(1:N,1:M) = h2;
DFT1 = fft2(ZP1);
DFT2 = fft2(ZP2);
figure;
subplot(1,2,1);imshow(log(abs(DFT1))+1,[]);title('DFT de imagen convolucionada con K1');
subplot(1,2,2);imshow(log(abs(DFT2))+1,[]);title('DFT de imagen convolucionada con K2');
0 个评论
采纳的回答
Star Strider
2016-11-21
You have a file in your user directory called ‘fft2’. Find it with:
which fft2 -all
then find the file in your user directory, and re-name it to something that does not conflict with any built-in MATLAB function name.
0 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Fourier Analysis and Filtering 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!