You're on right track...
>> for i=1:numel(b)
For each element that is changed in any of the input variables you need to build a name. You can construct the loop to either loop through and generate all the names first and store in cellstr or string array or, just build the filename inside the overall calculation loop at the point you're ready to use it.
An alternative would be to use some other "helper" functions...
4×1 cell array
In the above, the other variables that are single-valued are inherent in the definition of the anonymous function at the time it is defined. If one of those is to be changed, then the anonymous function must also be redefined to reflect that change.