This is usually not a good practice in MATLAB. The file containing the input variables will be a script in your example. Like your main file. MATLAB is not mistaken when running one script from another, as suggested by ScottieT812, but under certain circumstances strange errors may occur. (Run-time failure, problems with variable names in scripts)
The best option is to turn the script inputs into a function that returns the variables of interest
function [a,b c] = inputs
a = 5;
b = 6;
c = 7;
Then this function can be called in the main.m script.
% main.m
[a,b,c] = inputs;
s = a+b+c;
source
share