This is the code I have written:
x = 0:1:15;
U = 2*x+5;
L = 3*x-10;
u = 2*(x-1)+5;
l = 3*(x-1)-10;
U_plus = 2*(x+1)+5;
L_plus = 3*(x+1)-10;
c = abs(U_plus - L_plus);
C = abs(U-L);
C_plus = abs(u-l);
s1 = solve(abs(U_plus-L_plus)==0,x);
s2 = solve(abs(U-L)==0,x);
s3 = solve(abs(u-l)==0,x);
This is the error I am facing:
Error using sym.getEqnsVars>checkVariables (line 87)
Second argument must be a vector of symbolic variables.
Error in sym.getEqnsVars (line 54)
checkVariables(vars);
Error in solve>getEqns (line 429)
[eqns, vars] = sym.getEqnsVars(argv{:});
Error in solve (line 226)
[eqns,vars,options] = getEqns(varargin{:});
Error in Final (line 21)
s1 = solve(abs(U_plus-L_plus)==0,x);
Am unable to debug this. Any help is highly appreciated

 采纳的回答

syms x;
U = 2*x+5;
L = 3*x-10;
u = 2*(x-1)+5;
l = 3*(x-1)-10;
U_plus = 2*(x+1)+5;
L_plus = 3*(x+1)-10;
c = abs(U_plus - L_plus);
C = abs(U-L);
C_plus = abs(u-l);
s1 = solve(abs(U_plus-L_plus)==0,x)
s2 = solve(abs(U-L)==0,x)
s3 = solve(abs(u-l)==0,x)

更多回答(0 个)

类别

在 帮助中心 和 File Exchange 中查找有关 Numerical Integration and Differential Equations 的更多信息

产品

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by