Azzera filtri
Azzera filtri

Vertical lines on a graph from a CSV

1 visualizzazione (ultimi 30 giorni)
Nathan Kennedy
Nathan Kennedy il 5 Apr 2017
Commentato: KSSV il 6 Apr 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.

Risposte (0)

Community Treasure Hunt

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

Start Hunting!

Translated by