()-indexing must appear last in an index expression.

조회 수: 1 (최근 30일)
Fabio Corres
Fabio Corres 2019년 12월 17일
편집: Ridwan Alam 2019년 12월 18일
I have this formula. I interested in a DCP. but I want to find atmospheric light with this formula, not function.
for i=1:1:w
for j=1:1:h
A(i,j)=(min(Idark(i,j)>= A(i,j-1))(min(Idark(i,j): A(i,j-1))));
end
end
(w,h image size)
I write like this but it gives the error.( ()-indexing must appear last in an index expression.) can you help me
  댓글 수: 2
Ridwan Alam
Ridwan Alam 2019년 12월 17일
can you explain what this equation is representing? the way you implemented it is not correct.
Fabio Corres
Fabio Corres 2019년 12월 17일
where (i, j ) is the coordinate of image. A is simply equal to the minimum of Ω(i, j ) whose value is the largest in the scanned image.

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

채택된 답변

Ridwan Alam
Ridwan Alam 2019년 12월 18일
편집: Ridwan Alam 2019년 12월 18일
for i=1:1:w
for j=2:1:h
if (min(Idark(i,j))>= A(i,j-1))
A(i,j)=min(Idark(i,j));
else
A(i,j) = A(i,j-1);
end
end
end

추가 답변 (1개)

James Tursa
James Tursa 2019년 12월 17일
You've got closing and opening parentheses next to each other:
...)(...
MATLAB thinks you are trying to use the second part as indexing or function arguments into the first part. This is what you need to fix.

Community Treasure Hunt

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

Start Hunting!

Translated by