MATLAB Answers

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

4 views (last 30 days)
Mehmet Özbek
Mehmet Özbek on 17 Dec 2019
Edited: Ridwan Alam on 18 Dec 2019
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 Comments

Ridwan Alam
Ridwan Alam on 17 Dec 2019
can you explain what this equation is representing? the way you implemented it is not correct.
Mehmet Özbek
Mehmet Özbek on 17 Dec 2019
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.

Sign in to comment.

Accepted Answer

Ridwan Alam
Ridwan Alam on 18 Dec 2019
Edited: Ridwan Alam on 18 Dec 2019
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

  0 Comments

Sign in to comment.

More Answers (1)

James Tursa
James Tursa on 17 Dec 2019
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.

  0 Comments

Sign in to comment.

Sign in to answer this question.