Sei sulla pagina 1di 9

# x=0:1:7

x=

0 1 2 3 4 5 6 7

>> y=arcsin(sin(x))*(2/pi)

## Did you mean:

>> y=asin(sin(x))*(2/pi)

y=

## 0 0.6366 0.7268 0.0901 -0.5465 -0.8169 -0.1803 0.4563

>> plot(x,y)

>> x=linspace(0,2*pi,25);

>> y=asin(sin(2*x))*2/pi;

>> plot(x,y);

## plot(X,Y) plots vector Y versus vector X. If X or Y is a matrix,

then the vector is plotted versus the rows or columns of the matrix,

X.

## plot(Y) plots the columns of Y versus their index.

If Y is complex, plot(Y) is equivalent to plot(real(Y),imag(Y)).

## In all other uses of plot, the imaginary part is ignored.

Various line types, plot symbols and colors may be obtained with

## m magenta * star (none) no line

y yellow s square

k black d diamond

^ triangle (up)

p pentagram

h hexagram

## plot(X1,Y1,S1,X2,Y2,S2,X3,Y3,S3,...) combines the plots defined by

the (X,Y,S) triples, where the X's and Y's are vectors or matrices

## solid yellow line interpolating green circles at the data points.

The plot command, if no color is specified, makes automatic use of

## monochrome systems, plot cycles over the axes LineStyleOrder property.

Note that RGB colors in the ColorOrder property may differ from

## will create a plot with a dark red line width of 2 points.

Example

x = -pi:pi/10:pi;

y = tan(sin(x)) - sin(tan(x));

plot(x,y,'--rs','LineWidth',2,...

'MarkerEdgeColor','k',...

'MarkerFaceColor','g',...

'MarkerSize',10)

## Other functions named plot

>> plot(X,Y,'g--')

## Did you mean:

>> plot(x,y,'g--')

>> plot(x,y,'g--','LineWidth',2)

## grid ON adds major grid lines to the current axes.

grid OFF removes major and minor grid lines from the current axes.

grid MINOR toggles the minor grid lines of the current axes.

grid, by itself, toggles the major grid lines of the current axes.

## grid sets the XGrid, YGrid, and ZGrid properties of

the current axes. If the axes is a polar axes then grid sets

>> grid ON
>> grid MINOR

## xlabel('text') adds text beside the X-axis on the current axis.

xlabel('text','Property1',PropertyValue1,'Property2',PropertyValue2,...)

## xlabel(AX,...) adds the xlabel to the specified axes.

H = xlabel(...) returns the handle to the text object used as the label.

>> xlabel(AX)

## plot Linear plot.

plot(X,Y) plots vector Y versus vector X. If X or Y is a matrix,

then the vector is plotted versus the rows or columns of the matrix,

X.

## In all other uses of plot, the imaginary part is ignored.

Various line types, plot symbols and colors may be obtained with

## m magenta * star (none) no line

y yellow s square

k black d diamond

^ triangle (up)

p pentagram

h hexagram

## point but does not draw any line.

plot(X1,Y1,S1,X2,Y2,S2,X3,Y3,S3,...) combines the plots defined by

the (X,Y,S) triples, where the X's and Y's are vectors or matrices

## monochrome systems, plot cycles over the axes LineStyleOrder property.

Note that RGB colors in the ColorOrder property may differ from

## will create a plot with a dark red line width of 2 points.

Example

x = -pi:pi/10:pi;

y = tan(sin(x)) - sin(tan(x));

plot(x,y,'--rs','LineWidth',2,...

'MarkerEdgeColor','k',...

'MarkerFaceColor','g',...

'MarkerSize',10)

## Graphical plot editing tools

Plottools functions.

## plottools with no arguments is the same as ON.

Some plotting tools may not appear when you activate plottools. Only

those tools that were visible the last time you used them will be shown.

For example, if you were only using the Property Editor most recently,

only the Property Editor will be shown when you type "plottools on" or

activate the plot tools from the toolbar. You can then show the rest by

below.

## plottools (h, 'on')

The last argument may be the name of a specific component, like so:

## The available components are named 'figurepalette', 'plotbrowser',

and 'propertyeditor'.