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

2 ビュー (過去 30 日間)
Samantha Chong
Samantha Chong 2015 年 11 月 5 日
回答済み: Walter Roberson 2015 年 11 月 5 日
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 Center および File ExchangeWorkspace 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