Creating a function to read a text file
조회 수: 3 (최근 30일)
이전 댓글 표시
What is wrong with this code? I just want to parse a text file, and sort it into desperate arrays.
function [mass] = read(filex)
a = dlmread(filex);
mass = a(:, 3);
temp = a(:, 2);
time = a(:, 1);
end
댓글 수: 1
Walter Roberson
2016년 7월 15일
You do not indicate what problem you are encountering.
Your code should do something useful if you pass it a string which is the name of a text file that has no headers and which is comma or tab delimited.
답변 (1개)
Azzi Abdelmalek
2016년 7월 15일
function [mass,temp,time] = read(filex)
a = dlmread(filex);
mass = a(:, 3);
temp = a(:, 2);
time = a(:, 1);
참고 항목
카테고리
Help Center 및 File Exchange에서 Characters and Strings에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!