Error using * Inner matrix dimensions must agree.

2 ビュー (過去 30 日間)
srinu vas
srinu vas 2017 年 4 月 20 日
コメント済み: srinu vas 2017 年 4 月 20 日
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 件のコメント
Walter Roberson
Walter Roberson 2017 年 4 月 20 日
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
srinu vas 2017 年 4 月 20 日
thank you LST Variable line getting problem please run it ,I will send my data but I dn not have to send data from here thank you

サインインしてコメントする。

採用された回答

James Tursa
James Tursa 2017 年 4 月 20 日
編集済み: James Tursa 2017 年 4 月 20 日
Maybe you need to do element-wise multiply for that calculation using the .* operator (with the dot in the front) instead of the matrix multiply operator * (without the dot).
Also, not sure what you expect as a result when dividing by a cell. E.g., this line
LST = (BT)./{1 + (y*(BT)./P)*log(Ei)};
Did you mean for those curly braces { } to be parentheses instead ( ) ?
  1 件のコメント
srinu vas
srinu vas 2017 年 4 月 20 日
I was tried all ways getting same Error. THANK YOU

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeGeometric Geodesy についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by