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

3 visualizzazioni (ultimi 30 giorni)
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.

Risposta accettata

Sulaymon Eshkabilov
Sulaymon Eshkabilov il 21 Gen 2023
Modificato: Sulaymon Eshkabilov il 21 Gen 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 Commenti
Sheri
Sheri il 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 il 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);
>>

Accedi per commentare.

Più risposte (0)

Categorie

Scopri di più su Visual Exploration in Help Center e File Exchange

Prodotti


Release

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by