cellfunと同じ処理をtableに対して行う方法を教えてください。
显示 更早的评论
現在、添付ファイルのようなデータを分割して処理するためにtableをcellに変換し、処理を行っています。
出来ればtableのまま処理を行いたいのですが、何か方法はありますか?
filename = "test_cellfun.txt";
opts = detectImportOptions(filename);
opts.DataLines = [1 inf];
opts.VariableTypes = {'char', 'char'};
input_data = readtable(filename,opts);
x = table2cell(input_data(:,1));
x1 = cellfun(@(x) x(1:8),x,'UniformOutput',false);
x2 = cellfun(@(x) x(9:end),x,'UniformOutput',false);
y = table2cell(input_data(:,2));
y1 = cellfun(@(y) y(1:8),x,'UniformOutput',false);
y2 = cellfun(@(y) y(9:end),x,'UniformOutput',false);
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 行列および配列 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!