필터 지우기
필터 지우기

Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

fzero Index exceeds matrix dimensions, image processing

조회 수: 2 (최근 30일)
Diego Díaz-Barriga
Diego Díaz-Barriga 2016년 6월 11일
마감: MATLAB Answer Bot 2021년 8월 20일
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%%%%
IM(:,:,2)=double(geotiffread('LC80280452015160LGN00_B2.TIF'));
RED(:,:,4)=double(geotiffread('LC80280452015160LGN00_B4.TIF'));
%%%%%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%%%%
ASi(:,:,2)=double(geotiffread('B1.TIF'));
RSi(:,:,4)=double(geotiffread('B3.TIF'));
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%%%
[im1,Referencia]=geotiffread('LC80280452015160LGN00_B2.TIF');
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
dpb
dpb 2016년 6월 11일
>> 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.

답변 (1개)

Ian Hunter
Ian Hunter 2019년 2월 20일
You probably want to try one of matlab's optimization routines where you've set the optimization function to be at a minimum when your function crosses 0.
fmincon is an example.

이 질문은 마감되었습니다.

Community Treasure Hunt

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

Start Hunting!

Translated by