我正在尝试计算数组的 FFT,但出现错误:“数组大小不兼容”。我该如何解决这个问题?这是我的代码:
% Read the image
im = imread('image2.jpg');
% Convert the image to double precision
im = im2double(im);
% Compute the FFT of the image
F = fft2(im);
% Define the filter mask
mask = [-1 -1 -1; -1 8 -1; -1 -1 -1];
% Filter the FFT using the mask
F_filtered = F .* fftshift(mask);
% Display the magnitude of the filtered FFT
imshow(log(abs(fftshift(F_filtered))), []);
this error is coming
Arrays have incompatible sizes for this operation.
Error in task3 (line 32)
F_filtered = F .* fftshift(mask);