所以我想知道如何将预定义的变量输入到方程本身中。
这是代码。
function[A, B, C] = A_B_C_problem_generalized(lambda_1, lambda_2, mu_1, mu_2, gamma_1, gamma_2)
clear
clc
syms a1 a2 a4 b1 b2 b4 c1 c2 c4
[a1, a2, a4, b1, b2, b4, c1, c2, c4] = ...
solve('a1 + a4 = lambda_1 + lambda_2', ...
'a1*a4 - a2^2 = lambda_1 * lambda_2', ...
'b1 + b4 = mu_1 + mu_2', ...
'b1*b4 - b2^2 = mu_1 * mu_2', ...
'c1 + c4 = gamma_1 + gamma_2', ...
'c1*c4 - c2^2 = gamma_1 * gamma_2', ...
'c1 = a1 + b1', ...
'c2 = a2 + b2', ...
'c4 = a4 + b4');
...
我怎么能这样做呢?lambda、mu 和 gamma 应该是您输入的数字。