Prevent saving as invalid matlab variable name
Created by: Famlam
Matlab variable names must start with a letter, then either of letters, numbers or _
(https://www.mathworks.com/help/matlab/matlab_prog/variable-names.html) If the spectrum name doesn't satisfy this (e.g. a spectrum called "01_mysample_1H_echo"), convert it to something that can actually be read by Matlab. (Prefixing nmr_
to ensure the start with a letter, and replacing all invalid chars by _
)
Technically, it should also ensure the spectrum name isn't something like if
, for
, end
, ..., but let's ignore that for now as the likelyhood of that is small