Hi!
I found a solution!
my_param_list_name = {'var1' 'var2'} %extracting first the name of the variable
function [some_output] = name(some_input)
evalin('base', [my_param_list_name{i} '.CoderInfo.StorageClass = "ExportedGlobal"']);
end
Adding the = "ExportedGlobal" assignment into the string seems to have solved the problem