我想解方程组代码如下:c=300;
r1=20;
syms r2 R1 R2 l
eq1='R1-4*r1=0';
eq2='R2-2*r2=0';
eq3='2*300+1.57*(r1+R1)+(r1-R1)^2/(4*300)=2*300+1.57*(r2+R2)+(r2-R2)^2/(4*300)';
[r2,R1,R2]=solve(eq1,eq2,eq3,'r2,R1,R2')
问题是我知道c和r1,为什么结果还包含c和r1,应当怎么处理

 Akzeptierte Antwort

citivo
citivo am 24 Nov. 2022

0 Stimmen

写成 sol 是告诉你内定返回值顺序是 R1,R2,r2,这是一个结构体,要得到 R1,R2,r2可以用:
sol.R1
sol.R2
sol.r2
用sol做返回值的好处是不用关心返回值顺序。
由于现在已经知道正确的顺序是 R1,R2,r2,也可以写成正确的返回顺序:
[R1,R2,r2] = solve(eq1,eq2,eq3,r2,R1,R2)

Weitere Antworten (0)

Kategorien

Mehr zu 数学 finden Sie in Hilfe-Center und File Exchange

Tags

Gefragt:

am 24 Nov. 2022

Beantwortet:

am 24 Nov. 2022

Community Treasure Hunt

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

Start Hunting!