MATLAB POLYSPACE RELEASE NOTES Manual de usuario Pagina 79

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 240
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 78
Some Ways to Use MATLAB Plotting Tools
Some Wa ys to Use MATLAB Plotting Tools
In this section.. .
“Plotting Two Variables with Plotting Tools” on page 3-23
“Changing the Appearance of Lines and Markers” on page 3-26
“Adding M ore Data to the Graph” on page 3-27
“Changing the Type of Graph” on page 3-30
“Modifying the G raph Data Source” on page 3-32
Plotting Two Variables with Plotting Tools
Suppose you want to graph the function y=x
3
over the x domain -1 to 1. The
first step is to generate the data to plot.
It is simple to evaluate a function because M ATLAB can distribute arithmetic
operations over all elements of a multivalu ed v ariab le.
For e xample, th e following statement creates a variab l e
x that contains values
ranging from -1 to 1 in incrementsof0.1(youcouldalsousethe
linspace
function to generate data for x). The second statement raises each value in
x to the third power and stores these values in y:
x = -1:.1:1; % Define the range of x
y = x.^3; % Raise each element in x to the third power
Now that you have generated some d ata, you can plot it using the M ATLAB
plotting tools. To start the plotting tools, type
plottools
MATLAB displays a figure with plotting tools attached.
3-23
Vista de pagina 78
1 2 ... 74 75 76 77 78 79 80 81 82 83 84 ... 239 240

Comentarios a estos manuales

Sin comentarios