舉個例子,希望有所幫助。代碼:clc clear all syms x1 x2 a y = x1^2+x2^2 x01 = 2*a x02 = a^2 + a + 1 subs(y, [x1 x2], [x01 x02])結果 ans = 4*a^2 + (a^2 + a + 1)^2 >>