i would suggest creating a struct containing the required variables.
params.a = 1;
params.b = "very string"
params.c = [2,3,54];
result = my_func(params);
function result = my_func(params)
result = params.a;
There would also be declaring global variables.
i'd advice not to do that because it will come back to haunt you in future projects.
The goal of functions is to compute things in their own workspace and not affect other parts of the code with their local variables. You may quickly loose control of your code when assigning a lot of global variables and not being sure where they are interacted with.
In any case, if you are feeling lucky and want to try doing it with global variables, here is the doc: