MATLAB: Intensity distribution of a curve

areaintensityMATLAB

Hi, I have a curve with a certain bell shape.. I have measured an intensity of 200 nJ. I would like to apply this to the curve and get the intensity distribution that will give me this area = 200 nJ. I would like to find the corresponding intensity if you only look at part of the curve. Any idea how to do this?

Best Answer

I would do something like this:
x = -5:0.5:5; % Create Independent Variable
curve = exp(-x.^2); % Create Dependent Variable
original_curve_area = trapz(x, curve);
scaled_curve = curve * 200E-9/original_curve_area;
scaled_curve_fcn = @(xi) interp1(x, scaled_curve, xi, 'linear'); % Use The Appropriate ‘Method’ For Your Curve
xi = 0.33; % Desired Point On ‘scaled_curve’ Data
yi = scaled_curve_fcn(xi); % Corresponding Point On ‘scaled_curve’
figure(1)
plot(x,scaled_curve)
hold on
plot(xi, yi, 'pg', 'MarkerSize',15, 'MarkerFaceColor','g')
hold off
grid
The ‘scaled_curve_fcn’ uses the interpolation function interp1 to calculate the value of the curve for any value that is within the limits of the independent variable. Use it as you would use any other function. There are several interpolation method options available. I use 'linear' here, others may work better for your data. See the documentation on interp1 (link) for details.
Related Question