1
Matlab代碼內分配一個「if語句」:MATLAB,「環形」
eminc = 2.5; %the increment of the emission spectra you collected
exinc = 5; %the increment of the excitation spectra you collected
em = 250:eminc:560; %Emission scan
ex = 240:exinc:450; %Excitation scan
A = xlsread(char(Afile)); % Reads in raw EEM file in .xlsx format.
ExTop=[0,ex]; %Recreates the row of excitation wavelengths cut off
A=[ExTop ; A]; %Adds the excitation wavelengths back into the EEM file
Asize = size(A);
emfind = A(:,1);
emstart = find(emfind == findem(1));
emend = Asize(1);
exfind = A(emstart-1,:);
exstart = find(exfind == findex(1));
exend = Asize(2);
A = A(emstart:emend,exstart:exend);
for A=A(1:125,1:43)
if emstart<=(ex+10)
A=0;
if emstart>=(ex*2+20)
A=0;
end
end
end
數據是從激發 - 發射矩陣(大小125x43矩陣)的熒光強度,激發波長和發射波長(激發波長+10),當激發波長> =(激發)時,我想給數據矩陣賦0值(數據矩陣爲012×144波長* 2 + 20)
我知道for循環,如果語句不正確,主要是因爲我無法弄清楚如何在我的矩陣中調用該區域的數據。
該代碼有點「冗長」,所以如果掃描參數(激發和發射波長)發生改變,它們可以被分配,其餘代碼無論如何都可以工作。
任何幫助,將不勝感激。 感謝