how to draw gaussian curve
15 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
i have the value for FULL WIDTH AND HALF MAXIMUM and WAVELEGTH VALUE. using these things how can i plot the curve
0 Commenti
Risposte (1)
Ayush
il 5 Feb 2024
Questo/a risposta è stato/a segnalato/a da Aidan Connaughton
Hi,
It seems you are trying to make use of FULL WIDTH AND HALF MAXIMUM (FWHM) and wavelength values to obtain a Gaussian curve.
You can make use of the relation between "sigma" and "FWHM", which is given as:
sigma = FWHM / (2 * sqrt(2 * log(2)));
The sigma obtained can be used in the Gaussian curve formula along with the wavelength values. Refer to an example code below for a better understanding:
% Define the FWHM and central wavelength
FWHM = 10; % Replace with your actual FWHM value
central_wavelength = 500; % Replace with your actual wavelength value
% Calculate the standard deviation (sigma) from the FWHM
% The relationship between FWHM and sigma for a Gaussian function is:
% FWHM = 2 * sqrt(2 * log(2)) * sigma
sigma = FWHM / (2 * sqrt(2 * log(2)));
% Create a range of wavelength values around the central wavelength
wavelengths = linspace(central_wavelength - 3*FWHM, central_wavelength + 3*FWHM, 1000); % This is an example range and can be changed as per the requirements
% Calculate the Gaussian function values for those wavelengths
gaussian_values = (1 / (sigma * sqrt(2*pi))) * exp(-((wavelengths - central_wavelength).^2) / (2 * sigma^2));
% Plot the Gaussian curve
plot(wavelengths, gaussian_values);
title('Gaussian Curve');
xlabel('Wavelength');
ylabel('Intensity');
grid on;
0 Commenti
Vedere anche
Categorie
Scopri di più su Fit Postprocessing in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!