用matlab解含参变量的方程组x,y是需要输入的变量,运行syms x,y,A,C;x=3;y=3;[A,C]=solve('x*sin(A*pi/180)=y*sin(C*pi/180)','A+C=90')报错是y =3A =[ empty sym ]Warning:Explicit solution could not be found.> In solve at 98In jisuann at
来源:学生作业帮助网 编辑:六六作业网 时间:2024/09/12 06:04:16
用matlab解含参变量的方程组x,y是需要输入的变量,运行syms x,y,A,C;x=3;y=3;[A,C]=solve('x*sin(A*pi/180)=y*sin(C*pi/180)','A+C=90')报错是y =3A =[ empty sym ]Warning:Explicit solution could not be found.> In solve at 98In jisuann at
用matlab解含参变量的方程组
x,y是需要输入的变量,运行
syms x,y,A,C;
x=3;
y=3;
[A,C]=solve('x*sin(A*pi/180)=y*sin(C*pi/180)','A+C=90')
报错是
y =
3
A =
[ empty sym ]
Warning:Explicit solution could not be found.
> In solve at 98
In jisuann at 4
A =
[ empty sym ]
C =
[]
x=3,y=3只是举得一个例子,x,y值需要用户自己输入,
x=input('x=');
=input('y=');
这样还能代入方程么?
用matlab解含参变量的方程组x,y是需要输入的变量,运行syms x,y,A,C;x=3;y=3;[A,C]=solve('x*sin(A*pi/180)=y*sin(C*pi/180)','A+C=90')报错是y =3A =[ empty sym ]Warning:Explicit solution could not be found.> In solve at 98In jisuann at
clear;
syms x y a b;
[a,b,x,y]=solve('x*sin(a*pi/180)=y*sin(b*pi/180),a+b=90,x=3,y=3')
这样就可以了.
clc;
clear;
syms a b;
x=input('x=');
y=input('y=');
f1=a+b-90;
f2=x*sin(a*pi/180)-y*sin(b*pi/180);
S=solve(f1,f2);
S.a
S.b
这样就行了.