f = 
syms x
f = cos(x)
dfdx = diff(f)
dfdx = 
help fplot
fplot - Plot expression or function
This MATLAB function plots the curve defined by the function y = f(x)
over the default interval [-5 5] for x.
Syntax
fplot(f)
fplot(f,xinterval)
fplot(funx,funy)
fplot(funx,funy,tinterval)
fplot(___,LineSpec)
fplot(___,Name,Value)
fplot(ax,___)
fp = fplot(___)
[x,y] = fplot(___)
Input Arguments
f - Function to plot
function handle
xinterval - Interval for x
[–5 5] (default) | two-element vector of form [xmin xmax]
funx - Parametric function for x coordinates
function handle
funy - Parametric function for y coordinates
anonymous function | function handle
tinterval - Interval for t
[-5 5] (default) | two-element vector of form [tmin tmax]
ax - Axes object
axes object
LineSpec - Line style, marker, and color
string scalar | character vector
Name-Value Arguments
MeshDensity - Number of evaluation points
23 (default) | number
Color - Line color
[0 0.4470 0.7410] (default) | RGB triplet | hexadecimal color code |
"r" | "g" | "b" | ...
LineStyle - Line style
"-" (default) | "--" | ":" | "-." | "none"
LineWidth - Line width
0.5 (default) | positive value
Marker - Marker symbol
"none" (default) | "o" | "+" | "*" | "." | ...
MarkerEdgeColor - Marker outline color
"auto" (default) | RGB triplet | hexadecimal color code | "r" |
"g" | "b" | ...
MarkerFaceColor - Marker fill color
"none" (default) | "auto" | RGB triplet | hexadecimal color code |
"r" | "g" | "b" | ...
MarkerSize - Marker size
6 (default) | positive value
Output Arguments
fp - One or more FunctionLine or ParameterizedFunctionLine objects
scalar | vector
Examples
openExample('graphics/PlotExpressionExample')
openExample('graphics/PlotParametricCurveExample')
openExample('graphics/SpecifyPlottingIntervalAndPlotPiecewiseFunctionsExample')
openExample('graphics/SpecifyLinePropertiesAndDisplayMarkersExample')
openExample('graphics/ModifyPlotAfterCreationExample')
openExample('graphics/PlotMultipleLinesInSameAxesExample')
openExample('graphics/AddTitleAndAxisLabelsAndFormatTicksExample')
See also fcontour, fmesh, fplot3, fsurf, hold, title, fimplicit,
FunctionLine Properties, ParameterizedFunctionLine Properties
Introduced in MATLAB before R2006a
Documentation for fplot
doc fplot
Other uses of fplot
symbolic/fplot

