read data from filenames in dir structure with function
조회 수: 2 (최근 30일)
이전 댓글 표시
I wish to read data from a series of files in a structure called files
files=dir('data*.txt');
I can read the data within a .m file, but when I try to make this a function, including a filepath, I get the following error:
[data1, data2]=read_datafiles(files,PathName));
??? Undefined function or method 'read_datafiles' for input arguments
of type 'struct'.
I tried the structfun variants, but I'm not getting it.
댓글 수: 0
채택된 답변
Nathaniel
2012년 6월 9일
Is this the first line of read_datafiles.m ?
function [data1 data2] = read_datafiles(files, PathName)
I would guess that it's either not on the path, or doesn't have that line at the beginning.
댓글 수: 0
추가 답변 (2개)
참고 항목
카테고리
Help Center 및 File Exchange에서 File Operations에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!