EDIT:
I now fixed the code like this:
% Initialize results_edit to store the results
results_edit = {};
% Iterate through each cell array
for i = 1:numel(results_velocity_diff)
sub_cell_array = results_velocity_diff{i};
% Initialize a new sub cell array for the results
edit_sub_cell_array = {};
% Iterate through each table in the sub cell array
for j = 1:numel(sub_cell_array)
table_data = sub_cell_array{:,j};
edit_table = table(); % Initialize an empty table to store results
% Iterate through each column in the table
for col = 1:size(table_data, 2) % Using size instead of width for double array
% Apply the edit function to the current column
edit_result = edit(table_data(:, col), 0, 0, 0);
% Store the result in the edit table
% Creating a new variable name dynamically
var_name = ['Column_' num2str(col)]; % Creating generic names for double array columns
edit_table.(var_name) = edit_result;
end
% Store the table in the sub cell array
edit_sub_cell_array{end+1} = edit_table;
end
% Store the sub cell array in results_edit
results_edit{end+1} = edit_sub_cell_array;
end
But now I get a new error message which I cant solve:
Error using {}
Variable index exceeds table dimensions.
Error in
table_data = sub_cell_array{:,j};