How to read multiple .txt files and store into multiple variables in Matlab

1 次查看(过去 30 天)
Hi, I have 3 .txt files in a folder with different names such as "25Aug_CTD.txt", "26Aug_CTD.txt" and "27Aug_CTD.txt". Each of the .txt file is in this form (the values are different in each of the .txt file):
temp,salinity,trans
22.1,2.2,191
22.6,2.5,200
I'm trying to figure out how to store each of the numerical data from each of the .txt file into 3 different variables in Matlab. For example, the numerical data from "25Aug_CTD.txt" will be stored in the variable of 25Aug_CTD, numerical data from "26Aug_CTD.txt" will be stored in the variable of 26Aug_CTD and so on.

回答(1 个)

Walter Roberson
Walter Roberson 2015-11-5

类别

Help CenterFile Exchange 中查找有关 Workspace Variables and MAT Files 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by