How can I import multiple text files by clicking a button in MATLAB GUI ?
1 次查看(过去 30 天)
显示 更早的评论
Hello, everyone!
I have to import all the text files in a folder by clicking a button in MATLAB GUI. The file contains mixed data: Text in the starting lines, followed by columns headers and data in which first 2 columns are date and time and the remaining data contains float values). I am unable to do it. Please help me out.
Thank you.
2 个评论
KSSV
2017-3-24
There are functions like importdata, testread, textscan to read text files. Have you read those?
回答(1 个)
Nagini Venkata Krishna Kumari Palem
2017-3-28
In my understanding you are looking for solution to read text files of different formats. You can use 'uiimport' command from command window or use 'import data' option from home tab.
- Customize the format of imported data and variable names as required using the relevant options in import tool.
- Click on the drop-down menu under 'Import Selection' and select 'Generate Script'.
- Using the generated script, you can import data from other files in the same format, all you have to do is change the filename.
For more information you can refer to the following documentation pages,
If you are looking for how to import all the files from a folder, one possible solution would be to iterate through all the files in a loop.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Text Files 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!