At the end I found the solution to "send" the variables from the function workspace to the simulink workspace.
ModelName='NameOfYourSimulinkModel';
GenericArray = [1 2 3]; % Same name must be used in Simulink model
hws = get_param(ModelName,'modelworkspace'); % Handle the model's workspace
hws.DataSource = 'MAT-File';
hws.FileName = 'workspace';
hws.assignin('GenericArray', GenericArray); % Send variable