2D cross correlation between NIR and MIR data
    4 次查看(过去 30 天)
  
       显示 更早的评论
    
Hi everyone, can anyone help me on how to compute a 2D cross correlation analysis please. I have NIR and MIR absorbance dataset I need to peform a cross corrrelation to check for similar trends between the two responses. Can anyone assit me with the code to analyse this please? Thank you
The datasset is a 22 by 12001 NIR and 22 by 13001 MIR.
0 个评论
采纳的回答
  Gourab
      
 2023-6-7
        Hi Doyinsola,
I understand that you want to find the 2D  cross-correlation between NIR and MIR data matrices.
The `xcorr2()` function computes the cross-correlation between two 2D arrays, treating one as the reference and the other as the template. 
Please refer to the below code snippet on using the `xcorr2()` function.
% Load your NIR and MIR data from file
load('nir_data.mat');
load('mir_data.mat');
% Transpose the NIR and MIR data matrices
nir_data = nir_data.';
mir_data = mir_data.';
% Compute the cross-correlation between the NIR and MIR data
cc = xcorr2(nir_data, mir_data);
% Display the cross-correlation as an image
figure;
imagesc(abs(cc));
colormap('jet');
colorbar;
Please refer to the below documentation link for more information on ‘xcorr2()’ function.
I hope this helps you to resolve the query. 
更多回答(0 个)
另请参阅
类别
				在 Help Center 和 File Exchange 中查找有关 Particle & Nuclear Physics 的更多信息
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

