Computations in text files involving both numerical values and text
Mostrar comentarios más antiguos
Hi All, I have a text-file involving both text and numerical values. I want to multiple some of the values in the text file with a factor. I.e., I want all values below Res[f(p)] to be multiplied with 1.1. More specific: Value in Row 46 (9.30000E-01) to Row 60 (1.10000E+00) Value in Row 68 (2.40000E-01) to Row 82 (0.70000E+00) Value in Row 141 (4.30100E-01) to Row 155 (4.10100E+00) Value in Row 163 (1.32200E-01) to Row 177 (1.22400E+00) Value in Row 236 (1.30000E-01) to Row 250 (2.10000E+00) Value in Row 258 (2.10000E-01) to Row 272 (0.10000E+00) To all be multiplied with 1.1. Pattern: Start Row 46 and end Row 60. 15 values to be included. 7 Rows break. Start Row 68 and end Row 82. 15 values to be included. 58 Rows break. 15 values to be included. 7 Rows break. 15 values to be included. 58 Rows break. 15 values to be included. 7 Rows break. 15 values to be included. I want to save the file exactly as it was except for the modified values. I have attached the input file (Res.txt) and the wanted output file (OutputRes.txt). Can anyone help me out? Thank you in advance Kind regards,
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Text Files en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!