Error using * Inner matrix dimensions must agree.
Show older comments
I am trying from two days please Help
thank you ..
full code ......
Red = geotiffread('C:\Users\Adya\Desktop\matlab_workshop\LST\LST\images\band2.tif');
%figure(1),imshow(Red),title('BandRed');
NIRed = geotiffread('C:\Users\Adya\Desktop\matlab_workshop\LST\LST\images\Band3.tif');
%figure(2),imshow(NIRed),title('BandNIR');
R = histeq(Red);
NIR = histeq(NIRed);
R = im2double(R);
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
ndvi = (Pv.^2);
%COEFFICIENTS FOR THE ATMOSPHERIC IS Cj
Cj = 1;
%E = (0.004*ndvi+ 0.990*(1-ndvi));
%figure(6),imshow(E)
%colormap(jet),colorbar;
%impixelinfo
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 = geotiffread('C:\Users\Adya\Desktop\matlab_workshop\LST\LST\images\band14.tif');
DN = histeq(DN);
DN = im2double(DN);
%figure(),imshow(DN),title('Band14');
UCC = 0.005693;
L = (DN-1)*UCC;
%figure,imshow(L);
Conversion of Radiance to Brightness Temperature
K1 = 649.60;
K2 = 1274.49;
BT = ((K2) ./ log(((K1) ./ (L)) + 1));
% Y Lamb
y = 11.289;
%BT = (BT);
P = ((1.438)*(10.^-2));
%%calculation of LST
LST = (BT)./{1 + (y*(BT)./P)*log(Ei)};
%%imhist(LST),title('LST')
figure(6),imshow(LST),title('LST')
colormap(jet);
impixelinfo
%filename = 'C:\Users\Adya\Desktop\matlab_workshop\LST\LST\images\geotiffexample.tif';
%geotiffwrite(filename,LST);
2 Comments
Walter Roberson
on 20 Apr 2017
Which line is the problem occurring on?
We do not have your data files so we cannot run your code to test it.
srinu vas
on 20 Apr 2017
Accepted Answer
More Answers (0)
Categories
Find more on Geometric Geodesy in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!