I am finding the following error while running this code in MATLAB R2021a. Please help.
조회 수: 1 (최근 30일)
이전 댓글 표시
%% 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
댓글 수: 0
답변 (1개)
Cris LaPierre
2021년 6월 24일
편집: Cris LaPierre
2021년 6월 24일
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.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Encryption / Cryptography에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!