
- •Міністерство освіти і науки, молоді та спорту україни
- •Laboratory Works of Computing and Programming
- •Contents
- •1.2 Base Concepts of Operating Systems
- •1.3 Linux (lubuntu) Operating System
- •1.4 Tasks for Independent Work
- •1.5 Test Questions
- •2 Laboratory work № 2 Word Processor libreoffice.Writer
- •2.1 What Word Processors Can Do
- •2.2 Tasks for Independent Work
- •2.3 Test Questions
- •3 Laboratory work № 3
- •Introduction to the calc spreadsheet
- •3.1 The Basic Opportunities of Spreadsheets
- •3.1.1 Calc’s Environment
- •3.1.2 Calculations in Calc. Creating and Coping Formulas
- •3.2 The Calc charting capability
- •3.3 Tasks for Independent Work
- •4.2 Main Rules of Works in Scilab System
- •Variables
- •Input of vectors (arrays)
- •Input of matrixes
- •Some operations with matrixes with use of the operator ":"
- •Input from keyboard
- •Operators. Expressions use familiar arithmetic operators and precedence rules.
- •Intrinsic scilab Functions
- •Examples of Expressions
- •4.3 Individual Tasks for Laboratory Work
- •4.4 The Tasks for Self-Examination
- •4.5 Test Questions
- •5 Laboratory work № 5
- •5.3.1The plot function
- •5.3.3 Preparing Graphs for Presentation
- •Interactive Plot Editing
- •5.3.4 3D Plotting
- •5.4 Individual Tasks
- •5.6 Test Questions
- •6 Laboratory work № 6 programming in Scilab
- •6.1 Programming in scilab
- •What Happens When You Call a Function
- •Clearing Functions from Memory
- •6.2 Tasks for laboratory work
- •6.3 Example of performance of the laboratory work
- •6.4 Test Questions
- •7 ReferencEs
4.4 The Tasks for Self-Examination
Determine the result of the following commands:
-->a=[1 2 3; 4 5 6;7 8 9]
--> b1=[1; 2; 3]
-->c=[a b1]
--> e=[1 2 3; 4 5 ]
-->b=[a(1,2:end) a(3,end-1:-1:1)]
--> b2=[a(1,2:end); a(3,end-1:-1:1)]
-->a[:,2]=[]
4.5 Test Questions
What is SCILAB?
What features provides SCILAB?
What windows can you open in SCILAB?
What can you do in Command Window?
What is Work Space?
How to save variables from workspace in file?
What is variable?
How many digits of accuracy have Scilab numbers?
What types of variables do you know?
How to create a vector-row?
How to create a vector-column?
Suppose n is the column vector. What result following statement: >>n’ ?
How to input value from keyboard?
How to input data from file?
What arithmetic operations are used in SCILAB?
How to change evaluation order in arithmetic expressions?
What elementary mathematical functions do you know?
What difference between * and .* operators?
What functions for creating special matrices do you know?
5 Laboratory work № 5
creating plots in Scilab
5.1 Purpose of the Work
To study a few of the most important graphics functions and practical skills gaining of their use in the Scilab
5.2 The Task to Laboratory Work
1. Study item 5.3.
2. Repeat all examples adduced in item 5.3.
3. Carry out in Scilab the individual task - item 5.4.
4. Save the result of the work (protocol of the work, graphics) in your personal folder.
5. Draw up report.
5.3 The Basic Theoretical Knowledge
SCILAB provides a variety of functions for displaying vector data as line plots, as well as functions for annotating and printing these graphs. The following table summarizes the functions that produce basic line plots. These functions differ in the way they scale the plot's axes. Each accepts input in the form of vectors or matrices and automatically scales the axes to accommodate the data.
Table 5.1 - Basic Plotting Commands
р1оt(x,y) |
- Graph 2-D data with linear scales for both axes; |
loglog(x,y) |
- Graph with logarithmic scales for both axes; |
semilogx(x,y) |
- Graph with a logarithmic scale for the x-axis and a linear scale for the y-axis; |
semilogy(x,y) |
- Graph with a logarithmic scale for the y-axis and a linear scale for the x-axis; |
polar(φ,r) |
- creates a polar coordinate plot of the angle φ versus the radius r. φ is the angle from the x-axis to the radius vector specified in radians; r is the length of the radius vector specified in dataspace units.; |
plotyy(x,y,x,f) |
- Graph with y-tick labels on the left and right side; |
fplot(<nameFun>,limits) |
- plots function between the limits specified by limits. limits is a vector specifying the x-axis limits ([xmin xmax]), or the x- and y-axis limits, ([xmin xmax ymin ymax]).. |