rhoPart = 2540;
files = dir(fullfile(uigetdir,'\**\*.data*'));
[~,Index] = natsort({files.name});
files = files(Index);
folders = {files.folder};
folder_groups = findgroups(folders);
k = 1;
for i = 1:length(files)
fid = fopen(fullfile(files(i).folder,files(i).name),'r');
dataRead = textscan(fid,'%f %f %f %f %f %f %f %f %f %f %f %f %f %f','HeaderLines',1);
frewind(fid);
runData{k} = strsplit(fgetl(fid), ' ');
expData{k} = [dataRead{1}(:,1) dataRead{2}(:,1) dataRead{3}(:,1) dataRead{7}(:,1) dataRead{3}(:,1)+dataRead{7}(:,1) rhoPart*(4/3)*pi*(dataRead{7}(:,1).^3)];
velData{k} = [dataRead{4}(:,1) dataRead{5}(:,1) dataRead{6}(:,1) sqrt(dataRead{4}(:,1).^2 + dataRead{5}(:,1).^2 + dataRead{6}(:,1).^2)];
fclose(fid);
k = k + 1;
end
runData_struc = splitapply(@(x) {x}, runData, folder_groups);
expData_struc = splitapply(@(x) {x}, expData, folder_groups);
velData_struc = splitapply(@(x) {x}, velData, folder_groups);
9 Comments
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/596869-convert-a-non-uniform-cell-array-of-cell-arrays-to-matrix#comment_1016608
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/596869-convert-a-non-uniform-cell-array-of-cell-arrays-to-matrix#comment_1016608
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/596869-convert-a-non-uniform-cell-array-of-cell-arrays-to-matrix#comment_1016779
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/596869-convert-a-non-uniform-cell-array-of-cell-arrays-to-matrix#comment_1016779
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/596869-convert-a-non-uniform-cell-array-of-cell-arrays-to-matrix#comment_1016830
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/596869-convert-a-non-uniform-cell-array-of-cell-arrays-to-matrix#comment_1016830
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/596869-convert-a-non-uniform-cell-array-of-cell-arrays-to-matrix#comment_1017316
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/596869-convert-a-non-uniform-cell-array-of-cell-arrays-to-matrix#comment_1017316
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/596869-convert-a-non-uniform-cell-array-of-cell-arrays-to-matrix#comment_1017418
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/596869-convert-a-non-uniform-cell-array-of-cell-arrays-to-matrix#comment_1017418
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/596869-convert-a-non-uniform-cell-array-of-cell-arrays-to-matrix#comment_1017616
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/596869-convert-a-non-uniform-cell-array-of-cell-arrays-to-matrix#comment_1017616
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/596869-convert-a-non-uniform-cell-array-of-cell-arrays-to-matrix#comment_1021858
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/596869-convert-a-non-uniform-cell-array-of-cell-arrays-to-matrix#comment_1021858
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/596869-convert-a-non-uniform-cell-array-of-cell-arrays-to-matrix#comment_1022107
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/596869-convert-a-non-uniform-cell-array-of-cell-arrays-to-matrix#comment_1022107
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/596869-convert-a-non-uniform-cell-array-of-cell-arrays-to-matrix#comment_1023889
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/596869-convert-a-non-uniform-cell-array-of-cell-arrays-to-matrix#comment_1023889
Sign in to comment.