Filter löschen
Filter löschen

Vertical lines on a graph from a CSV

1 Ansicht (letzte 30 Tage)
Nathan Kennedy
Nathan Kennedy am 5 Apr. 2017
Kommentiert: KSSV am 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.
  1 Kommentar
KSSV
KSSV am 6 Apr. 2017
try
hh = vline(wavelengthEmission[i],'r','element[i]')

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Community Treasure Hunt

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

Start Hunting!

Translated by