I am finding the following error while running this code in MATLAB R2021a. Please help.

2 visualizaciones (últimos 30 días)
%% Golomb coding/decoding for grayscale images
I=imread('N17.jpg');
I=double(I);
[size_x,size_y]=size(I);
I_dec=zeros(size_x,size_y); %decoded image will be stored in this matrix
m=randi(size_x,size_y,[1,max(max(I(:,:)))]); % generate a random set of coding parameters
% Encoding/Decoding for image
for i=1:1:size_x
for j=1:1:size_y
x = golomb_enco(I(i,j),m(i,j));
I_dec(i,j) = golomb_deco(x, m(i,j));
end
end
% Test to verify correct decoding
if isequal(I_dec,I)
fprintf('Decoding successful');
end
Error using randi
Size inputs must be scalar.
Error in golombexec (line 40)
m=randi(size_x,[1,max(max(I(:,:)))],size_y); % generate a random
set of coding parameters

Respuestas (1)

Cris LaPierre
Cris LaPierre el 24 de Jun. de 2021
Editada: Cris LaPierre el 24 de Jun. de 2021
It looks like MATLAB has determined you are trying to use this syntax:
Consult the documentation if that is not the syntax you intended to use.

Categorías

Más información sobre Encryption / Cryptography en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by