findpeaks in a for loop
Show older comments
I would like to use the findpeaks function to calculate the peaks of the different rows of the DT matrix obtained with the for loop.
Could someone explain to me how to do it?
Thanks in advance
% Input parameters
r= 0.006; % radius[m]
k= 5e-7; % thermal diffusivity[m^2/s]
pc= 1e6; % volumetric heat capacity[J/m*3*K]
qs= 62.5; % heat input per unit of lenght per unit of time[J/m*s]
t0= [1 10 100 1000]; % heating duration[s]
Qs= qs./pc; % source strenght per unit time[m*2*K/s]
n=100;
% for loop
for i=1:length(t0)
time = logspace(0,4,n);
idH = find(time < t0(i));
idC = find(time>=t0(i));
tH = time(idH);
tC = time(idC);
t= [tH tC];
DeltaTH = (-Qs./(4.*pi.*k)).*-expint((r.^2)./(4.*k.*tH));
DeltaTC = (Qs./(4.*pi.*k)).*-(expint((r.^2)./(4.*k.*(tC-t0(i))))-expint((r.^2)./(4.*k.*tC)));
DT(i,:) = [DeltaTH DeltaTC];
end
Accepted Answer
More Answers (0)
Categories
Find more on Spectral Measurements 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!