%() Error: Illegal use of reserved keyword "end".

3 次查看(过去 30 天)
clc;
clearvars;
close all;
% % % % % % %
% % % % % %
I =imread("moon.tif");
I=imresize(I,[512,512]);
% I=rgb2gray(I);
figure(1);
imshow(I);
% % % % % % % % %
% % % % % % % % Fourth Order PDEs % % % % % % % % % %
T=1.0;
I1=fpdepyou(I,T);
figure; imshow(I,[]); title('Original image');
N = 50; % Number of contaminated realizations
Ic = NaN(size(I,1),size(I,2),N); % 3D matrix that holds the 'N' realizations
sigma = 1.5; % Strandart deviation of the Gaussian distributions
Mult_noise = NaN(size(I)); % Multiplicative noise
%% Contamination of the 'N' realizations:
for ID_realz = 1:N
rng('shuffle');
Mult_noise = (sigma*randn(size(I)))+((1j)*(sigma*randn(size(I))));
Ic(:,:,ID_realz) = abs(I.*Mult_noise);
clear('Mult_noise');
end;
Error using .*
Complex integer arithmetic is not supported.

采纳的回答

Sulaymon Eshkabilov
编辑:Sulaymon Eshkabilov 2023-1-21
Here is the corrected part of your code:
...
for ID_realz = 1:N
rng('shuffle');
Mult_noise = (sigma*randn(size(I)))+((1j)*(sigma*randn(size(I))));
Ic(:,:,ID_realz) = double(I).*abs(Mult_noise);
clear('Mult_noise');
end
  2 个评论
Sheri
Sheri 2023-2-6
Unable to perform assignment
because the size of the left
side is 512-by-512 and the size
of the right side is
512-by-512-by-3.
Sheri
Sheri 2023-2-6
Unable to perform assignment
because the size of the left
side is 512-by-512 and the size
of the right side is
512-by-512-by-3.
Error in six_ferb_4th_OPDE (line 34)
Ic(:,:,ID_realz) = double(I).*abs(Mult_noise);
>>

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Visual Exploration 的更多信息

产品


版本

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by