function myfun(year, type, gof)
year1 = {1994, 1994, 1994, 1994, 1994, 1994, 1994, 1994, 1994}.';
year2 = {1995, 1995, 1995, 1995, 1995, 1995, 1995, 1995, 1995}.';
type1 = {'AA', 'AA', 'AA', 'AA', 'AA', 'AA', 'AA', 'AA', 'AA'}.';
type2 = {'BB', 'BB', 'BB', 'BB', 'BB', 'BB', 'AA', 'BB', 'BB'}.';
gof1 = {'CC', 'CC', 'CC', 'CC', 'CC', 'CC', 'CC', 'CC', 'CC'}.';
gof2 = {'DD', 'DD', 'DD', 'DD', 'DD', 'DD', 'DD', 'DD', 'DD'}.';
t = table(year1, type1, year2, type2, gof1, gof2);
year = {'year1', 'year2'};
type = {'type1', 'type2'};
gof = {'gof1', 'gof2'};
if nargin == 0
else
user_request = {year, type, gof};
[~, f_order] = ismember(t.Properties.VariableNames, user_request);
[~, g_order] = sort(f_order);
t = t(:, g_order);
end
file = table2cell(t);
xlswrite('output.xlsx', file);
0 Comments
Sign in to comment.