Info
此问题已关闭。 请重新打开它进行编辑或回答。
fzero Index exceeds matrix dimensions, image processing
2 次查看(过去 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.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/166358/image.png)
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!