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-a*b*n^3',0)这个程序错在哪?为啥说我没有给参数赋值?(我的是6.5的MATLAB)Error using ==> fzeroFZERO cannot
来源:学生作业帮助网 编辑:六六作业网 时间:2024/11/06 06:59:21
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-a*b*n^3',0)这个程序错在哪?为啥说我没有给参数赋值?(我的是6.5的MATLAB)Error using ==> fzeroFZERO cannot
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-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)
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-a*b*n^3',0)这个程序错在哪?为啥说我没有给参数赋值?(我的是6.5的MATLAB)Error using ==> fzeroFZERO cannot
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')