Info

# fzero Index exceeds matrix dimensions, image processing

1 view (last 30 days)
Diego Díaz-Barriga on 11 Jun 2016
Closed: MATLAB Answer Bot on 20 Aug 2021
hi everybody, im processing satelite imagenary, the last step in the process is a nonlinear ecuation so I'm using Fzero but it continues telling me that index exceeds matrix dimensions here is my script.
%%%%cargar imagenes%%%%
%%%%%TOA%%%%%%
%Banda Azul=2
A(:,:,2)=IM(:,:,2)*0.00002;
A1(:,:,2)=A(:,:,2)+0.1;
Atoa(:,:,2)=A1(:,:,2)/0.9279549148;
%banda Roja=4
R(:,:,4)=double(RED(:,:,4)*0.00002);
R1(:,:,4)=R(:,:,4)+0.1;
toar(:,:,4)=R1(:,:,4)/0.9279549148;
figure, imshow(toar(:,:,4))
figure, imshow(Atoa(:,:,2))
%%%%Reflectancia superficie%%%%
AS(:,:,2)=ASi(:,:,2)/10000;
RS(:,:,4)=RSi(:,:,4)/10000;
%%%%AOT%%%%
F=@(t)((0.665483767.*(Atoa(:,:,2)-0.091226952-((exp(-1 .*(0.242593401+t(:,:,2))).*exp(-1 .*(0.242593401+t(:,:,2))/0.927954915).*AS(:,:,2))./(1-AS(:,:,2).*(0.92.*0.242593401+(1-0.725681).*t(:,:,2)).*exp(-1 .*(0.242593401+t(:,:,2)))))))-t(:,:,2));
X(:,:,2)=fzero(F,1);
%%%Guardar%%%
info=geotiffinfo('LC80280452015160LGN00_B2.TIF');
geotiffwrite('toar',toar,Referencia,'GeoKeyDirectoryTag', info.GeoTIFFTags.GeoKeyDirectoryTag);
this is te equation wich I'm having trouble.
where PTOA, Ps, and Ta are images
##### 1 CommentShowHide None
dpb on 11 Jun 2016
>> help fzero
...
fun is the function whose zero is to be
computed. It accepts a scalar x and returns a scalar f
Your function doesn't play by the rules it would appear.