Determine Peak Widths
Create a signal that consists of a sum of Gaussian curves. Specify the location, height, and width of each curve.
x = linspace(0,1,1000); Pos = [1 2 3 5 7 8]'/10; Hgt = [7 6 3 2 2 3]'; Wdt = [3 8 4 3 4 6]'/100; y = sum(Hgt.*(exp(-((x-Pos)./Wdt).^2)),1);
Measure the widths of the peaks using half prominence and half height as reference.
tiledlayout("flow") nexttile findpeaks(y,x,Annotate="extents") title("Half-Prominence Peak Widths") nexttile findpeaks(y,x,Annotate="extents",WidthReference="halfheight") title("Half-Height Peak Widths")

Select the tallest peaks separated by at least 0.5 units in the x-axis. Measure the widths of the peaks using half prominence and half height as reference.
figure tiledlayout("flow") nexttile findpeaks(y,x,MinPeakDistance=0.5,Annotate="extents") title("Half-Prominence Peak Widths") nexttile findpeaks(y,x,MinPeakDistance=0.5,Annotate="extents", ... WidthReference="halfheight") title("Half-Height Peak Widths")

Only the first and last peaks satisfy the minimum separation condition, so the widths displayed in the plot correspond to these two peaks. The extent of each peak remains unchanged, so the peak width preserves its value regardless of the conditions specified and whether the peak is selected or not.