how to create a function for loading data
1 次查看(过去 30 天)
显示 更早的评论
Dear all,
I have question about how to create a function for loading data from file.
for example: I have a code, but I import datas from 2 different txt file. now I want to create a function for choosing these files and code will automatically work. how can we solve this problem??
thanks
0 个评论
回答(1 个)
Azzi Abdelmalek
2014-4-1
You, already have a function that loads your data
file='file1.txt'
data=dlmread(file)
2 个评论
Azzi Abdelmalek
2014-4-1
files={'data1.txt','data2.txt'},
out=cellfun(@(x) dlmread(x),files,'un',0)
celldisp(out)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Dynamic System Models 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!