function [mrv,sig] = rv(w,f) % Function to compute RV's from spectra interactively. % % D. Holmgren holmgren@phobos.astro.uwo.ca wl = [6331.95 6347.10]; nl = input('Number of lines: '); for k = 1:nl wlo = input('Enter lower lambda limit: '); whi = input('Enter upper lambda limit: '); plot(w,f) axis([wlo whi min(f) max(f)]) [ix,iy] = ginput(1); rv(k) = 300000 * (ix(1) - wl(k))/wl(k); end mrv = mean(rv); sig = std(rv)/sqrt(nl); axis; clg