We cannot tell for sure what size x is. If inputmatrices is a multi-line edit field in which there was one entry per line, then that would be received as a column vector cell array, and the str2num() into x would be a column vector. (1 x L) * (1 x L).' would be 1 x L * L x 1 which would give 1 x 1, so the left part of the subtraction in T might be 1 x 1. But the right part M*I is going to be a matrix, so we have to assume that T will be an N x N numeric matrix result.
But an N x N numeric matrix result is not a string, and the way it gets converted into a string for display is probably not going to be to your liking. You should do explicit conversion to character or string array or cell array of character vectors in the format you want.
Note by the way that
are both fetching from the same handle.