YOMEDIA
ADSENSE
Lecture note Data visualization - Chapter 32
15
lượt xem 1
download
lượt xem 1
download
Download
Vui lòng tải xuống để xem tài liệu đầy đủ
This chapter presents the following content: Matlab environment, built-in matlab functions, plotting, user-defined functions, numerical techniques, matlab environment, numerical techniques,...
AMBIENT/
Chủ đề:
Bình luận(0) Đăng nhập để gửi bình luận!
Nội dung Text: Lecture note Data visualization - Chapter 32
- Lecture 32
- Chapter 4 "Inheritance" Inheritance is a powerful feature that allows the reuse of code. However, be sure that functions applied to objects created at run time through the new operator are bound at run time. This feature is known as dynamic binding, and the use of virtual functions is required to ensure that runtime decisions are made. Reread this chapter as often as necessary to ensure that you understand the distinctions among nonvirtual functions
- Chapter 6 “Algorithm Analysis" In this chapter we introduced algorithm analysis and showed that algorithmic decisions generally influence the running time of a program much more than programming tricks do We also showed the huge difference between the running times for quadratic and linear programs and illustrated that cubic algorithms are, for the most part, unsatisfactory We examined an algorithm that could be viewed as the basis for our first data structure The binary search efficiently supports static operations thereby providing a logarithmic worstcase search
- Data Visualization with MATLAB Chapter 2 “MATLAB Environment” Chapter 3 “Builtin MATLAB Functions” Chapter 5 “Plotting” Chapter 6 “UserDefined Functions” Chapter 13 “Numerical Techniques”
- Chapter 2 "MATLAB Environment" In this chapter, we introduced the basic MATLAB structure The MATLAB environment includes multiple windows, four of which are open in the default view: Command window Command history window Workspace window Current folder window In addition, the
- Continued…. Variables defined in MATLAB follow common computer naming conventions: Names must start with a letter. Letters, numbers, and the underscore are the only characters allowed. Names are case sensitive. Names may be of any length, although only the first 63 characters are used by MATLAB Some keywords are reserved by MATLAB and cannot be used as variable names MATLAB allows the user to reassign function names as
- Continued…. Matrices often store numeric information, although they can store other kinds of information as well Data can be entered into a matrix manually or can be retrieved from stored data files When entered manually, a matrix is enclosed in square brackets, elements in a row are separated by either commas or spaces, and a new row is indicated by a semicolon: a = [1 2 3 4; 5 6 7 8] Evenly spaced matrices can be generated with the colon
- Continued…. MATLAB follows the standard algebraic order of operations MATLAB supports both standard (decimal) and scientific notation It also supports a number of different display options. No matter how values are displayed, they are stored as doubleprecision floatingpoint numbers MATLAB variables can be saved or imported from either .MAT or .DAT files The .MAT format is proprietary to MATLAB and is used because it stores data more efficiently than other file
- Chapter 3 “Builtin MATLAB Functions" General mathematical functions, such as exponential functions logarithmic functions roots Rounding functions Functions used in discrete mathematics, such as factoring functions primenumber functions Trigonometric functions, including
- Continued…. Data analysis functions, such as maxima and minima averages (mean and median) sums and products sorting standard deviation and variance Randomnumber generation for both uniform distributions Gaussian (normal) distributions
- Chapter 5 “Plotting" The most commonly used graph in engineering is the x – y plot This twodimensional plot can be used to graph data or to visualize mathematical functions No matter what a graph represents, it should always include a title and x and y axis labels Axis labels should be descriptive and should include units, such as ft/s or kJ/kg MATLAB includes extensive options for controlling the appearance of your plots The user can specify the color, line style, and marker style for each line on a graph
- Continued…. In addition to x – y plots, MATLAB offers a variety of plotting options, including polar plots, pie charts, bar graphs, histograms, and x – y graphs with two y –axes The scaling on x – y plots can be modified to produce logarithmic plots on either or both x – and y axes Engineers often use logarithmic scaling to represent data as a straight line The function fplot allows the user to plot a function without defining a vector of x and y –values MATLAB automatically chooses the appropriate number
- Continued…. The threedimensional plotting options in MATLAB include a line plot, a number of surface plots, and contour plots Most of the options available in two dimensional plotting also apply to these threedimensional plots The meshgrid function is especially useful in creating threedimensional surface plots Interactive tools allow the user to modify existing plots These tools are available from the figure menu bar Plots can also be created with the interactive plotting option from the workspace window
- Chapter 6 “User Defined Functions" MATLAB contains a wide variety of builtin functions However, you will often find it useful to create your own MATLAB functions The most common type of userdefined MATLAB function is the function Mfile, which must start with a functiondefinition line that contains the word function a variable that defines the function output a function name a variable used for the input argument
- Continued…. The function name must also be the name of the Mfile in which the function is stored Function names follow the standard MATLAB naming rules Like the builtin functions, userdefined functions can accept multiple inputs and can return multiple results Comments immediately following the functiondefinition line can be accessed from the command window with the help command Variables defined within a function are local to that function. They are not stored in the workspace and cannot
- Continued…. Groups of userdefined functions, called “toolboxes,” may be stored in a common directory and accessed by modifying the MATLAB® search path. This is accomplished interactively with the path tool, either from the menu bar, as in File > Set Path or from the command line, with pathtool MATLAB provides access to numerous toolboxes developed at The MathWorks or by the user community Another type of function is the anonymous function,
- Chapter 13 “Numerical Techniques" Tables of data are useful for summarizing technical information However, if a value is needed that is not included in the table, must approximate that value by using some sort of interpolation technique MATLAB includes such a technique, called interp1 . This function requires three inputs: a set of x values, a corresponding set of y values, and a set of x values for which you would like to estimate y values The function defaults to a linear interpolation technique, which assumes that approximate these intermediate y
- Continued…. A different linear function is found for each set of two data points, ensuring that the line approximating the data always passes through the tabulated points The interp1 function can also model the data by using higherorder approximations, the most common of which is the cubic spline The approximation technique is specified as a character string in a fourth optional field of the interp1 function If it’s not specified, the function defaults to linear interpolation. An example of the syntax is new_y = interp1(tabulated_x, tabulated_y, new_x, 'spline')
- Continued…. In addition to the interp1 function, MATLAB includes a twodimensional interpolation function called interp2 , a threedimensional interpolation function called interp3 , and a multidimensional interpolation function called interpn Curvefitting routines are similar to interpolation techniques However, instead of connecting data points, they look for an equation that models the data as accurately as possible Once you have an equation, you can calculate the corresponding values of y
- Continued….
ADSENSE
CÓ THỂ BẠN MUỐN DOWNLOAD
Thêm tài liệu vào bộ sưu tập có sẵn:
Báo xấu
LAVA
AANETWORK
TRỢ GIÚP
HỖ TRỢ KHÁCH HÀNG
Chịu trách nhiệm nội dung:
Nguyễn Công Hà - Giám đốc Công ty TNHH TÀI LIỆU TRỰC TUYẾN VI NA
LIÊN HỆ
Địa chỉ: P402, 54A Nơ Trang Long, Phường 14, Q.Bình Thạnh, TP.HCM
Hotline: 093 303 0098
Email: support@tailieu.vn