>> subName = ["10", "12"]; size(subName), 1:size(subName)
size() with a single parameter always returns a vector with at least two elements. When you give the colon operator a non-scalar value (such as a vector of length 2), then it ignores everything except the first value... which in this case is 1, the number of rows in subName.
You should probably be using something like
load( fullfile(InputFolder, "S" + subName(i) + "_data.mat") )
and better yet would be to assign the result of load() to a variable, instead of "poofing" variables into existence.