Main Content

ezpolar

(Not recommended) Easy-to-use polar coordinate plotter

  • Easy-to-use polar coordinate plotter

ezpolar is not recommended. Use fpolarplot instead. (since R2024a) For more information on updating your code, see Version History.

Description

ezpolar(f) plots the curve defined by the function rho = f(theta) over the default interval [0, 2π] for theta.

ezpolar automatically adds a title to the bottom of the plot.

example

ezpolar(f,thetainterval) plots over the specified interval. Specify the interval as a two-element vector of the form [thetamin thetamax].

ezpolar(ax,___) plots into the axes specified by ax. Specify the axes as the first input argument in any of the previous syntaxes.

h = ezpolar(___) returns a Line object. Use h to modify properties of the plot after creating it. For a list of properties, see Line Properties.

Examples

collapse all

Plot the function 1+cos(θ) over the interval [0, 2π].

ezpolar("1+cos(theta)")

Plot of the polar function 1+cos(theta)

Input Arguments

collapse all

Function to plot, specified as a character vector, string scalar, or function handle to a named or anonymous function.

Specify a function of the form rho = f(theta). The function must accept at least one vector input argument and return a vector output argument of the same size.

If you specify the function as a character vector or string scalar, then multiplication, division, and exponentiation are performed as element-wise operations. For example, theta^2 is interpreted as theta.^2.

Example: ezpolar("sin(theta^2)")

If you specify the function as a function handle, use array operators instead of matrix operators for the best performance. For example, use .* (times) instead of * (mtimes).

Example: ezpolar(@(theta) sin(theta).*cos(theta))

If you specify a function that accepts more than one input argument, specify the function as an anonymous function.

Example: ezpolar(@(theta,arg2,arg3) myfun(theta,arg2,arg3))

Interval for theta, specified as a two-element vector of the form [thetamin thetamax].

Axes object. If you do not specify this argument, then ezpolar uses the current axes (gca).

Extended Capabilities

Version History

Introduced before R2006a

expand all