Extract or import two Specific values form Text file
2 次查看(过去 30 天)
显示 更早的评论
I am working on a problem in MATLAB, in which I need to import two specific values (highlighted) from a text file as shown in the figure 1.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/192445/image.png)
And corresponding txt file is attached below.
采纳的回答
madhan ravi
2018-7-24
Try this:
fid = fopen('M7_soil_FN_1.txt','rt');
C = textscan(fid,'%f%f','HeaderLines',6);
fclose(fid);
C{1}
C{2}
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Data Import and Export 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!