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

1 view (last 30 days)
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.

Accepted Answer

Sulaymon Eshkabilov
Sulaymon Eshkabilov on 21 Jan 2023
Edited: Sulaymon Eshkabilov on 21 Jan 2023
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 Comments
Sheri
Sheri on 6 Feb 2023
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 on 6 Feb 2023
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);
>>

Sign in to comment.

More Answers (0)

Categories

Find more on Visual Exploration in Help Center and File Exchange

Products


Release

R2022b

Community Treasure Hunt

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

Start Hunting!