MATLAB中fzero()的问题~
P=9.33;T=300.2;n=2;a=4.17;b=0.0371;R=0.08206;V=fzero('P*V^3-(P*n*b+n*R*T)*V^2+a*n^2*V...
P = 9.33;
T = 300.2;
n = 2;
a = 4.17;
b = 0.0371;
R = 0.08206;
V=fzero('P*V^3-(P*n*b+n*R*T)*V^2+a*n^2*V-a*b*n^3',0)
这个程序错在哪?为啥说我没有给参数赋值??(我的是6.5的MATLAB)
??? Error using ==> fzero
FZERO cannot continue because user supplied expression ==> P*V^3-(P*n*b+n*R*T)*V^2+a*n^2*V-a*b*n^3
failed with the error below.
Error using ==> inlineeval
Error in inline expression ==> P*V^3-(P*n*b+n*R*T)*V^2+a*n^2*V-a*b*n^3
??? Undefined function or variable 'P'.
Error in ==> E:\MATLAB6p5\work\Untitled.m
On line 7 ==> V=fzero('P*V^3-(P*n*b+n*R*T)*V^2+a*n^2*V-a*b*n^3',0) 展开
T = 300.2;
n = 2;
a = 4.17;
b = 0.0371;
R = 0.08206;
V=fzero('P*V^3-(P*n*b+n*R*T)*V^2+a*n^2*V-a*b*n^3',0)
这个程序错在哪?为啥说我没有给参数赋值??(我的是6.5的MATLAB)
??? Error using ==> fzero
FZERO cannot continue because user supplied expression ==> P*V^3-(P*n*b+n*R*T)*V^2+a*n^2*V-a*b*n^3
failed with the error below.
Error using ==> inlineeval
Error in inline expression ==> P*V^3-(P*n*b+n*R*T)*V^2+a*n^2*V-a*b*n^3
??? Undefined function or variable 'P'.
Error in ==> E:\MATLAB6p5\work\Untitled.m
On line 7 ==> V=fzero('P*V^3-(P*n*b+n*R*T)*V^2+a*n^2*V-a*b*n^3',0) 展开
1个回答
2009-12-07
展开全部
clear
syms V
P = 9.33;
T = 300.2;
n = 2;
a = 4.17;
b = 0.0371;
R = 0.08206;
V=solve('P*V^3-(P*n*b+n*R*T)*V^2+a*n^2*V-a*b*n^3=0','V')
syms V
P = 9.33;
T = 300.2;
n = 2;
a = 4.17;
b = 0.0371;
R = 0.08206;
V=solve('P*V^3-(P*n*b+n*R*T)*V^2+a*n^2*V-a*b*n^3=0','V')
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询