Arrows from x-axis
arrows originating from the x-axis. Specify the direction of arrows
using the Cartesian components
U indicating the x-components and
V indicating the y-components. The
nth arrow has its base at n on the
x-axis. The number of arrows matches the number of elements in
feather( plots arrows using the complex
values specified by
Z, with the real part indicating the
x-components and the imaginary part indicating the
y-components. This syntax is equivalent to
f = feather(___) returns a vector of
Line objects with
length(U)+1 elements. The first
length(U) elements represent individual arrows, and the last element
represents a horizontal line along the x-axis. Use these
Line objects to control the appearance of the plot after creating
Create a feather plot by specifying the components of each arrow as Cartesian values. The nth arrow originates from n on the x-axis.
t = -pi/2:pi/8:pi/2; u = 10*sin(t); v = 10*cos(t); feather(u,v)
Create a feather plot using polar coordinates by first converting them to Cartesian coordinates.
To do this, create vectors with polar coordinates. Convert them to Cartesian coordinates using the
pol2cart function. Then, create the plot.
th = -pi/2:pi/16:0; r = 10*ones(size(th)); [u,v] = pol2cart(th,r); feather(u,v)
Create a vector of complex values. Then, display them using a feather plot. The real part determines the x-component of each arrow, and the imaginary part determines the y-component.
Z = [2+3i -1-3i -1+i 2i 3-4i -2-2i -2+4i 0.5-i -3i 1+i]; feather(Z)
Create a feather plot with red arrows.
t = -pi/2:pi/8:pi/2; u = 10*sin(t); v = 10*cos(t); feather(u,v,'r')
Specify the line width and color of a single arrow by assigning the arrow to a variable and then setting its properties. To do this, first create a feather plot and return an array of
t = -pi/2:pi/8:pi/2; u = 10*sin(t); v = 10*cos(t); f = feather(u,v);
Assign the first arrow to a variable. The first arrow corresponds to the first elements of
v. Then, change the line width and color.
f1 = f(1); f1.Color = 'r'; f1.LineWidth = 2;
Starting in R2019b, you can display a tiling of plots using the
nexttile functions. Call the
tiledlayout function to create a 1-by-2 tiled chart layout. Call the
nexttile function to create an axes object and return the object as
ax1. Create the left plot by passing
ax1 to the
feather function. Add a title to the plot by passing the axes to the
title function. Repeat the process to create the right plot.
tiledlayout(1,2) % Left plot ax1 = nexttile; t = 0:pi/8:pi/2; u1 = 10*sin(t); v1 = 10*cos(t); feather(ax1,u1,v1) title(ax1,'Left Plot') % Right plot ax2 = nexttile; u2 = zeros(5,1); v2 = [1 -2 3 -4 5]; feather(ax2,u2,v2) title(ax2,'Right Plot')
Z— Complex values
Complex values, specified as a scalar, vector, or matrix. The real part of
Z indicates the x-components of arrows, and
the imaginary part indicates the y-components.
LineSpec— Line style, marker, and color
Line style, marker, and color, specified as a character vector or string containing symbols. The symbols can appear in any order. You do not need to specify all three characteristics (line style, marker, and color). For example, if you omit the line style and specify the marker, then the plot shows only the marker and no line.
'--or' is a red dashed line with circle markers
ax— Target axes
Target axes, specified as an
Usage notes and limitations:
This function accepts GPU arrays, but does not run on a GPU.
For more information, see Run MATLAB Functions on a GPU (Parallel Computing Toolbox).
Usage notes and limitations:
This function operates on distributed arrays, but executes in the client MATLAB®.
For more information, see Run MATLAB Functions with Distributed Arrays (Parallel Computing Toolbox).