- Load the experimental data: You can do this by using the ‘load’ function.
- Load the LIBS dataset: You can load the LIBS database into MATLAB using the load command depending upon the format of file.
- Preprocess the datasets: Preprocess the datasets to make any necessary changes if required to remove noise or perform adjustments.
- Iterating through database: Iterate through the LIBS database for each element to find the peak positions for the required features and compare it with the corresponding experimental data. You can store them in a new column or as a new variable. You can use functions like ‘max’, ‘findpeaks’ for finding the peaks.
Script for automatic assignment of peaks using a database
6 次查看(过去 30 天)
显示 更早的评论
I am working on LIBS for identification of elemental composition. I am doing this by comparing my experimental data with a LIBS database. However, I have been doing this by plotting each of the element in the database with my experimental data. I need help on writing a script that can automatically assign peaks based on the comparison for all element at once to save time. Can anyone guide me on writing the script please?
Hint: LIBS database consist of individual spectrum of Intensity vs wavelength for many elements based on choice while experiment data is just a single spectra of intensity vs wavelength.
0 个评论
回答(1 个)
Shivansh
2023-8-29
Hi Doyinsola,
I have provided the basic outline of the script which can be used to gain the above results. I have assumed that you have the datasets in a format accepted by MATLAB such as ‘.csv’ or ‘.xlsx’.
for i = 1:num_elements
Max_Val= max(DataSet(i,Col_Num));
Col_to_compare(i) = Max_Val;
end
num_elemnts: Total number of elemnts.
Col_Num = Column number of interest.
Col_to_compare = Column storing values for comparison purposes.
5. You can analyse and visualise the results now by generating plots or performing statistical calculations.
Links to the documentations for the functions
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!