Студопедия
Случайная страница | ТОМ-1 | ТОМ-2 | ТОМ-3
АвтомобилиАстрономияБиологияГеографияДом и садДругие языкиДругоеИнформатика
ИсторияКультураЛитератураЛогикаМатематикаМедицинаМеталлургияМеханика
ОбразованиеОхрана трудаПедагогикаПолитикаПравоПсихологияРелигияРиторика
СоциологияСпортСтроительствоТехнологияТуризмФизикаФилософияФинансы
ХимияЧерчениеЭкологияЭкономикаЭлектроника

Printing from the Menu

Читайте также:
  1. DNA Fingerprinting

There are four menu options under the File menu that pertain to printing:

· the Page Setup option displays a dialog box that enables you to adjust characteristics of the figure on the printed page.

· the Print Setup option displays a dialog box that sets printing defaults, but does not actually print the figure.

· the Print Preview option enables you to view the figure the way it will look on the printed page.

· the Print option displays a dialog box that lets you select standard printing options and print the figure.

Generally, use Print Preview to determine whether the printed output is what you want. If not, use the Page Setup dialog box to change the output settings. Select the Page Setup dialog box Help button to display information on how to set up the page.

Exporting Figure to Graphics Files

The Export option under the File menu enables you to export the figure to a variety of standard graphics file formats.

D Plotting

Scilab provides many powerful instructions for the visualization of 3D data. The instructions provided include tools to plot wire-frame objects, 3D plots, curves, surfaces, and can automatically generate contours, display volumetric data, interpolate shading colors. Here are some commonly used functions (there are many more):

plot3, stem3, pie3, comet3, contour3, mesh, meshc,

surf, surfc, sphere, ellipsoid, cylinder.

Among these instructions, plot3 and comet3 are the 3D matches of plot and comet commands mentioned in the 2D plot section.

The 3D plot functions intended for plotting meshes and surfaces 'mesh' and 'surf', and their several variants 'meshc', 'meshz', 'surfc', and 'surfl', take multiple optional input arguments, the most simple form being 'mesh(z)' or 'surf(z)', where z represents a matrix.

Usually, tridimensional curves are represented by the values of z-coordinates samples on a grid of (x,y) values.

Thus, to create a surface or 3D plot we first need to generate a grid of (x,y) coordinates and find the height (z-coordinate) of the surface at each of the grid points. Scilab provides the function 'meshgrid' to create a grid of points over a specified range.

Meshgrid

Suppose that you want to plot the function z = x2 – 10y + 2 over the domain 0 ≤ x ≤ 4 and 0 ≤ y ≤ 4. To do so, we first take several points in the domain, say 25 points, as shown in fig.5.6:

Figure 5.6 - Grid to calculate the function

We can create two matrices x and y, each of size 5 x 5, and write the xy-coordinates of each point in these matrices. We can then evaluate z with the command z = x.^2 – 10*y + 2.

However, creating the two matrices x and y is much easier with the meshgrid command.

 

>>vx = 0: 4 % creates vectors x and y, from 0 to 4

vx = 0 1 2 3 4

 

>>vy = vx

vy = 0 1 2 3 4

>>[x,y] = meshgrid(vx,vy) % creates meshgrid to be used in 3D plot

x = 0 1 2 3 4

0 1 2 3 4

0 1 2 3 4

0 1 2 3 4

0 1 2 3 4

y = 0 0 0 0 0

1 1 1 1 1

2 2 2 2 2

3 3 3 3 3

4 4 4 4 4

 

The commands shown above generate the 25 points shown in the figure. All we need to do is generate two vectors, vx and vy, to define the region of interest and distribution or density of our grid points. Also, this two vectors do not have to be either the same size or linearly spaced. It is very important to understand the use of meshgrid.

See the columns of x and the rows of y. When a surface is plotted with the 'mesh(z)' command (where z is a matrix), the tickmarks on the x and y axes do not indicate the domain of z but the row and column indices of the z-matrix. Typing 'mesh(x,y,z)' or 'surf(x,y,z)' (where x and y are vectors used by 'meshgrid' to create a grid), result in the surface plot of z, with x and y values shown along the respective axes.


Дата добавления: 2015-10-29; просмотров: 152 | Нарушение авторских прав


Читайте в этой же книге: The Basic Opportunities of Spreadsheets | Calculations in Calc. Creating and Coping Formulas | Operators. Expressions use familiar arithmetic operators and precedence rules. | Intrinsic SCILAB Functions | Examples of Expressions | Multiple Data Sets in One Graph |
<== предыдущая страница | следующая страница ==>
Plotting Lines and Markers| Individual Tasks

mybiblioteka.su - 2015-2024 год. (0.01 сек.)