例:我的文本信息如下:我只想要下面的数字信息,上面的文本和字符串信息不保留
节点QJ-001-_Reflection_1.txt的数据
Date: Wed Jun 17 14:39:28 CST 2020
User: Administrator
Spectrometer: MAYP111907
触发模式: 0
积分时间 (秒): 1.200000E-2
Scans to average: 10
启用暗噪声校正: true
启用非线性校正: true
滑动平均宽度: 5
X轴模式: Wavelengths
Number of Pixels in Spectrum: 2068
>>>>>Begin Spectral Data<<<<<
199.274 49.68
199.744 47.95
200.215 47.92
200.685 47.9
201.156 47.18
201.626 47.09
202.096 46.63
202.567 46.7
203.037 46.85
203.507 46.69
203.977 46.34
204.448 47.25
采用readmatrix函数即可,A = readmatrix(filename)
即可将上面的信息导入到matlab中并保存为矩阵信息。
官网参考:https://ww2.mathworks.cn/help/matlab/ref/readmatrix.html#mw_020aafa6-861b-42e8-bc54-7c71b32a6066