Info
この質問は閉じられています。 編集または回答するには再度開いてください。
fzero Index exceeds matrix dimensions, image processing
3 ビュー (過去 30 日間)
古いコメントを表示
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
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
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.
0 件のコメント
この質問は閉じられています。
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!