matlab:matlab_examples
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionLast revisionBoth sides next revision | ||
matlab:matlab_examples [2016/05/01 03:58] – [Returning multiple values] mithat | matlab:matlab_examples [2016/05/04 01:56] – [m-files with main function] mithat | ||
---|---|---|---|
Line 62: | Line 62: | ||
d = disc(a, b, c); | d = disc(a, b, c); | ||
- | x1 = (-b + d) / (2*a); | + | x1 = (-b + sqrt(d)) / (2*a); |
- | x2 = (-b - d) / (2*a); | + | x2 = (-b - sqrt(d)) / (2*a); |
end | end | ||
Line 69: | Line 69: | ||
% dis = disc(a,b,c) | % dis = disc(a,b,c) | ||
% Return the discriminant of a, b, c. | % Return the discriminant of a, b, c. | ||
- | dis = sqrt(b^2 - 4*a*c); | + | dis = b^2 - 4*a*c; |
end | end | ||
</ | </ |
matlab/matlab_examples.txt · Last modified: 2021/12/07 19:41 by mithat