📄 quadratic.m
字号:
function x = quadratic(a,b,c)% QUADRATIC Find roots of a quadratic equation.%% X = QUADRATIC(A,B,C) returns the two roots of the quadratic equation%% y = A*x^2 + B*x + C. %% The roots are contained in X = [X1 X2].% A. Knight, July 1997delta = 4*a*c;denom = 2*a;rootdisc = sqrt(b.^2 - delta); % Square root of the discriminantx1 = (-b + rootdisc)./denom; x2 = (-b - rootdisc)./denom;x = [x1 x2];
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -