"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');

採用された回答

Star Strider
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 件)

カテゴリ

Help Center および File ExchangeFourier Analysis and Filtering についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by