Problem with fzero()?
1 次查看(过去 30 天)
显示 更早的评论
clc
clear all
close all
CStrain = 0.001536;
eps_i = 0.00192;
f_i = 377.76;
fy = 425;
Es = 200000;
eps_y = fy/Es;
PointTB = [eps_i, f_i];
eps_n = 0.0018777;
eps_p = (PointTB(1) - eps_n)/eps_n;
Kp = eps_p/eps_n;
A = 1.9*(Kp)^(-0.1);
R = 10*(Kp)^(-0.2);
% xfun = @(x) x^2 + 2*x - 4;
% x = fzero(xfun,1)
xfun = @(x) (CStrain - eps_i) - ((x - fy)/Es)*(1 + (A^(-R))*((x - f_i)/fy)^(R-1));
x = fzero(xfun,1)
In the above mentioned code, I do not know the initial guess in fzero() function, hence I gave as "1", but the program is returning a error, as shown below
Error using fzero (line 309)
Function value at starting guess must be finite
and real.
Error in Rough (line 27)
x = fzero(xfun,1)
Could anyone please help me how to solve the problem and get the value of "x".
Thanks in advance...
0 个评论
回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!