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

조회 수: 3 (최근 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 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