You may consider using lists (AKA "systems" ). If the input values are obtained as matrix, then the function sys2mat from the CustomFunctions
Plugin may help.

Martin KraskaPre-configured portable distribution of SMath Studio: https://en.smath.info/wiki/SMath%20with%20Plugins.ashx