필터 지우기
필터 지우기

how to resolve the error index exceeds matrix dimensions

조회 수: 1 (최근 30일)
SIBI SIVA
SIBI SIVA 2016년 10월 3일
댓글: SIBI SIVA 2016년 10월 16일
k1=1;
for i=19:29
imag4=imscram(:,:,i);
subplot(:,:,i);
imshow(imag4);
[lllo,lhlo,hllo,hhlo]=dwt2(double(imag4),'haar');
llw(:,:,k1)=lllo(:,:);
lhw(:,:,k1)=lhlo(:,:);
hlw(:,:,k1)=hllo(:,:);
hhw(:,:,k1)=hhlo(:,:);
k1=k1+1;
figure
end
  댓글 수: 1
KSSV
KSSV 2016년 10월 3일
The matrices given are not known to us. How you expect to find the error?

댓글을 달려면 로그인하십시오.

채택된 답변

Walter Roberson
Walter Roberson 2016년 10월 3일
If subplot() is an array, then
subplot(:,:,i);
is at best a waste of time, as that would extract a portion of the array and then throw the extracted value away because of the semi-colon. If the array had a third dimension smaller than 29, you would get an error about the index exceeding the dimension.
If subplot() is the MATLAB plotting function, then passing a colon to it is not valid.
  댓글 수: 1
SIBI SIVA
SIBI SIVA 2016년 10월 16일
thank you for your suggestion. now my code is working.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Matrix Indexing에 대해 자세히 알아보기

태그

아직 태그를 입력하지 않았습니다.

Community Treasure Hunt

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

Start Hunting!

Translated by