Effacer les filtres
Effacer les filtres

Vertical lines on a graph from a CSV

1 vue (au cours des 30 derniers jours)
Nathan Kennedy
Nathan Kennedy le 5 Avr 2017
Commenté : KSSV le 6 Avr 2017
Hi,
I have a CSV file that has many elements and their emission line at a specific wavelength. On my graph I want to draw all these straight vertical lines for each element. The graph is Wavelength against intensity.
I currently am able to manually enter in each line using
Lyman_alpha = vline(937.06,'r','Lyman Alpha')
Where 937.06 is the wavelength and r makes the line red.
However I have over 60 emission lines to place on my graph, is there anyway this can be done with a few lines of code? I tried this but failed miserably
emissionlines =csvread('emissionlines.csv');
element = emissionlines(:, 1);
wavelengthEmission = emissionlines(:, 2);
element[i] = vline(wavelengthEmission[i],'r','element[i]') <--- Fails here
findpeaks(SFD,wavelength,'Threshold',6)
PS. I'm new to MATLAB.
  1 commentaire
KSSV
KSSV le 6 Avr 2017
try
hh = vline(wavelengthEmission[i],'r','element[i]')

Connectez-vous pour commenter.

Réponses (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by