MATLAB: Decimal number as filed name of a structure

field name

how can I set this as field name ? since it has a decimal in it , Matlab doesn't accept it to be field name . If i could get rid of the dot, it works but i don't know how ?
'One_IMj_4_Story_Selected_Records_Set_0.01SA_0.99dNSA'.

Best Answer

You could find and replace the dots ...
fn = 'One_IMj_4_Story_Selected_Records_Set_0.01SA_0.99dNSA'
fn2 = regexprep(fn,'\.','_dot_')
fn2 =
'One_IMj_4_Story_Selected_Records_Set_0_dot_01SA_0_dot_99dNSA'