Suppose we have a quadratic equation y = ax^2 + bx + c
, we can plot this curve in MATLAB using the following steps:
plot
function.Here is an example code snippet:
main.m72 chars9 lines
This will plot a simple quadratic with a minimum value at x = -b/2a
and a y value of c-b^2/4a
. You can adjust the range of x values and the coefficients to plot any quadratic you want.
gistlibby LogSnag