FUNCTION REFERENCE
fplot
Plot a function of x.
Plot a function of x.
Syntax
fp = fplot(f)Syntax
fp = fplot(f, [xmin xmax])Syntax
fp = fplot(..., linespec, Name, Value)Evaluates the function handle f on [xmin xmax] (default [-5 5]) and draws the curve. Sampling starts with MeshDensity (default 23) equally spaced points including both limits; each round tests the midpoint of every interval and keeps bisecting where the midpoint deviates from the chord by more than 0.1 % of the y range, at most 10 rounds and 5000 points. Handles that are not vectorized (the call on the vector of x values errors, as @(x) x^2 does, or returns the wrong number of values) are evaluated point by point. get answers Function, XRange, MeshDensity, XData and YData; set of XRange or MeshDensity resamples.
Example
fp = fplot(@(x) x.^2, [-1 2]); x = get(fp, 'XData'); [x(1) x(end)] % [-1 2]Differences from MATLAB: parametric fplot(funx, funy) and automatic pole detection are not supported; the curve is not resampled when the axes are zoomed.
These are the engine’s help pages. Each page keeps its compatibility notes. File operations are unavailable in the browser.