MATLAB求解方程组
x^2+y^2=1xy=2%ex_20.mfunctionz=ex_20(p)z(1)=p(1)^2+p(2)^2;z(2)=p(1)*p(2);保存,然后输入fsolv...
x^2+y^2=1
xy=2
%ex_20.m
function z=ex_20(p)
z(1)=p(1)^2+p(2)^2;
z(2)=p(1)*p(2);
保存,然后输入
fsolve x=('ex_20',[0 0])
这样对吗?
错了,保存后输入
x=fsolve('ex_20',[0 0]) 展开
xy=2
%ex_20.m
function z=ex_20(p)
z(1)=p(1)^2+p(2)^2;
z(2)=p(1)*p(2);
保存,然后输入
fsolve x=('ex_20',[0 0])
这样对吗?
错了,保存后输入
x=fsolve('ex_20',[0 0]) 展开
展开全部
>> [x,y]=solve('x^2+y^2=1','x*y=2','x','y')
x =
((15^(1/2)*i)/2 + 1/2)^(1/2)/2 - ((15^(1/2)*i)/2 + 1/2)^(3/2)/2
((15^(1/2)*i)/2 + 1/2)^(3/2)/2 - ((15^(1/2)*i)/2 + 1/2)^(1/2)/2
(1/2 - (15^(1/2)*i)/2)^(1/2)/2 - (1/2 - (15^(1/2)*i)/2)^(3/2)/2
(1/2 - (15^(1/2)*i)/2)^(3/2)/2 - (1/2 - (15^(1/2)*i)/2)^(1/2)/2
y =
((15^(1/2)*i)/2 + 1/2)^(1/2)
-(1/2*15^(1/2)*i + 1/2)^(1/2)
(1/2 - (15^(1/2)*i)/2)^(1/2)
-(1/2 - 1/2*15^(1/2)*i)^(1/2)
>> x=vpa(x)
x =
1.1180339887498948482045868343656 - 0.86602540378443864676372317075294*i
0.86602540378443864676372317075294*i - 1.1180339887498948482045868343656
0.86602540378443864676372317075294*i + 1.1180339887498948482045868343656
- 0.86602540378443864676372317075294*i - 1.1180339887498948482045868343656
>> y=vpa(y)
y =
0.86602540378443864676372317075294*i + 1.1180339887498948482045868343656
- 0.86602540378443864676372317075294*i - 1.1180339887498948482045868343656
1.1180339887498948482045868343656 - 0.86602540378443864676372317075294*i
0.86602540378443864676372317075294*i - 1.1180339887498948482045868343656
>> ex_20([1 1])
ans =
2 1
x =
((15^(1/2)*i)/2 + 1/2)^(1/2)/2 - ((15^(1/2)*i)/2 + 1/2)^(3/2)/2
((15^(1/2)*i)/2 + 1/2)^(3/2)/2 - ((15^(1/2)*i)/2 + 1/2)^(1/2)/2
(1/2 - (15^(1/2)*i)/2)^(1/2)/2 - (1/2 - (15^(1/2)*i)/2)^(3/2)/2
(1/2 - (15^(1/2)*i)/2)^(3/2)/2 - (1/2 - (15^(1/2)*i)/2)^(1/2)/2
y =
((15^(1/2)*i)/2 + 1/2)^(1/2)
-(1/2*15^(1/2)*i + 1/2)^(1/2)
(1/2 - (15^(1/2)*i)/2)^(1/2)
-(1/2 - 1/2*15^(1/2)*i)^(1/2)
>> x=vpa(x)
x =
1.1180339887498948482045868343656 - 0.86602540378443864676372317075294*i
0.86602540378443864676372317075294*i - 1.1180339887498948482045868343656
0.86602540378443864676372317075294*i + 1.1180339887498948482045868343656
- 0.86602540378443864676372317075294*i - 1.1180339887498948482045868343656
>> y=vpa(y)
y =
0.86602540378443864676372317075294*i + 1.1180339887498948482045868343656
- 0.86602540378443864676372317075294*i - 1.1180339887498948482045868343656
1.1180339887498948482045868343656 - 0.86602540378443864676372317075294*i
0.86602540378443864676372317075294*i - 1.1180339887498948482045868343656
>> ex_20([1 1])
ans =
2 1
火丰科技
2024-11-13 广告
2024-11-13 广告
致力于从事惯性测量、卫星导航等产品的研发、生产的高新技术企业。公司旗下投资多条自动化生产线分别分布于西安、深圳、珠海等地,其中包括光纤陀螺、MEMS惯导、石英加速度计、电子对抗通信产品生产线,拥有中国先进的惯性导航产品及电子对抗产品生产条件...
点击进入详情页
本回答由火丰科技提供
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询