Subscript indices must either be real positive integers or logicals.

1 view (last 30 days)
BT = (K2) ./ (log((K1 ./ L+ 1)));
y = int16(11.289);
P = (1.438*10.^-2);
Problem comes from this
LST = (BT)./(1 + y(BT))./(P)*(log(Ei));
  2 Comments
srinu vas
srinu vas on 27 Mar 2017
Red = geotiffread('C:\Users\syduxps\Desktop\Desktop-26-02-2017\Matlab_Workshop\aster\Aster\band2.tif'); figure(1),imshow(Red),title('BandRed'); NIRed = geotiffread('C:\Users\syduxps\Desktop\Desktop-26-02-2017\Matlab_Workshop\aster\Aster\Band3.tif'); figure(2),imshow(NIRed),title('BandNIR'); R = histeq(Red); NIR = histeq(NIRed);
R = im2double®; NIR = im2double(NIR); %% %Estimation of NDVI ndvi = (NIR -R) ./ (NIR + R);
figure(3),imhist(ndvi) figure(4),imshow(ndvi, []), title('NDVI'); text(size(ndvi,2), size(ndvi,1) + 15,... 'Positive values shows the Vegetation and Negative values shows the NoneType Vegetation',... 'FontSize', 8, 'HorizontalAlignment', 'right');
colormap(jet),colorbar; impixelinfo %% %Estimation of Land Surface Emissivity%% %NDVIs = soils %NDVIv = Vegetation NDVIs = 0.2; NDVIv = 0.5;
Pv = (ndvi - NDVIs) ./ (NDVIv - NDVIs); ndvi = (Pv.^2); Cj = 0; Ei = (NDVIs*ndvi + NDVIv*(1-ndvi) + Cj); figure(5),imshow(Ei),title('Emissivity'); colormap(jet),colorbar; impixelinfo
%% %Conversion of Digital Numbers (DNs) to Radiance DN = 4094; UCC = 0.005225; L = (DN - 1)*UCC; %% % Conversion of Radiance to Brightness Temperature K1 = 649.60; K2 = 1274.49;
BT = (K2) ./ (log((K1 ./ L+ 1))); y = int16(fix(11.289)); P = (1.438*10.^-2);
LST = (BT)./(1 + y*(BT))./(P)*(log)*((Ei));

Sign in to comment.

Accepted Answer

Joshua
Joshua on 27 Mar 2017
I am not really sure what BT is, but depending on your values of K1, K2, and L, it probably won't be an integer. For example, with K1=1, K2=1, and L=1, BT=1.4427. y(BT) tries to access the 1.4427th index of y which does not exist. You need to change your code so BT is always an integer.
Or maybe you want y*BT instead for multiplication?
  1 Comment
srinu vas
srinu vas on 27 Mar 2017
Thank you very much for reply ... Here see full code ...
Red = geotiffread('C:\Users\syduxps\Desktop\Desktop-26-02-2017\Matlab_Workshop\aster\Aster\band2.tif'); figure(1),imshow(Red),title('BandRed'); NIRed = geotiffread('C:\Users\syduxps\Desktop\Desktop-26-02-2017\Matlab_Workshop\aster\Aster\Band3.tif'); figure(2),imshow(NIRed),title('BandNIR'); R = histeq(Red); NIR = histeq(NIRed);
R = im2double®; NIR = im2double(NIR); %% %Estimation of NDVI ndvi = (NIR -R) ./ (NIR + R);
figure(3),imhist(ndvi) figure(4),imshow(ndvi, []), title('NDVI'); text(size(ndvi,2), size(ndvi,1) + 15,... 'Positive values shows the Vegetation and Negative values shows the NoneType Vegetation',... 'FontSize', 8, 'HorizontalAlignment', 'right');
colormap(jet),colorbar; impixelinfo %% %Estimation of Land Surface Emissivity%% %NDVIs = soils %NDVIv = Vegetation NDVIs = 0.2; NDVIv = 0.5;
Pv = (ndvi - NDVIs) ./ (NDVIv - NDVIs); ndvi = (Pv.^2); Cj = 0; Ei = (NDVIs*ndvi + NDVIv*(1-ndvi) + Cj); figure(5),imshow(Ei),title('Emissivity'); colormap(jet),colorbar; impixelinfo
%% %Conversion of Digital Numbers (DNs) to Radiance DN = 4094; UCC = 0.005225; L = (DN - 1)*UCC; %% % Conversion of Radiance to Brightness Temperature K1 = 649.60; K2 = 1274.49;
BT = (K2) ./ (log((K1 ./ L+ 1))); y = int16(fix(11.289)); P = (1.438*10.^-2);
LST = (BT)./(1 + y*(BT))./(P)*(log)*((Ei));

Sign in to comment.

More Answers (1)

Image Analyst
Image Analyst on 27 Mar 2017

Community Treasure Hunt

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

Start Hunting!