"Draft paper" Matlab

Source: Internet
Author: User

MATLAB is an analysis and simulation tool for the control system. In foreign countries, especially in the United States, famous universities included MATLAB in the teaching program of electrical engineering courses at the end of 1980s. Become a required tool for college students and graduate students and experimental environments.
Compared with earlier versions, the current version of MATLAB 4.xis easier to use and more friendly to build vectors, arrays, and matrices. The output result is visualized and is very popular. Its application has gradually evolved from the initial automatic control field to the signal processing, image processing, and engineering problem solving fields.
Running MATLAB creates one or more windows on the computer screen. The command window is the main place for users to interact with MATLAB (MATLAB command window), as shown in 1.
I. mathematical operations
Just like a calculator, Matlab achieves the same as "draft paper". Users can input the formula and output the result.
Example:> 4*25 + 6*22 + 2*99 note:> indicates the cursor
Ans =
Sometimes it is difficult to solve the problem. For example, the root of X ** 4-12x ** 3 + 0x ** 2 + 116 = 0. Note: ** is the multiplication square.
> P = [1-12 0 25 116]
> R = roots (P)
R = 11.7473.
-1.2251 + 1.4672 I
-1.2251-1.4672 I
Is it convenient! MATLAB can solve problems for you: array and matrix operations, polynomial root, multiplication, division, addition, subtraction, differentiation, integral and Fourier transformation operations.
Ii. Numerical Analysis
In the face of a pile of data, you have to spend a lot of energy on advanced language programming, but if you have MATLAB, this process is much simpler. According to the analysis of the maximum temperature change in three cities in a month, you only need to enter a few simple lines to get the result (2 ).
> Temps1 = [
12 15 12 14 12 11 15 8 12 12 14 11 9 8 8 10 129 12 12 12 10 139 10 14 12 13 13 12;
8 9 5 86 9 9 10 77 10 8 7 88 9 7 88 8 9 12 10 6 7 5 7 10 11 12; 18 22 19 23 22 19 15 20 18 19 17 23 19 18 20 22 19 21 20 17 20 22 22 22 22 22 22 22 22 22]
> Temps = temps1'
> D =;
> Plot (D, temps)
> Xlabel ('maximum temperature per Day') and ylabel ('degree Celsius ')
> Title ('daily high temperatures in three cities (Unit C) ') You can also use MATLAB functions to process various types of data.
3. Drawing Images
MATLAB can easily draw 2D and 3D diagrams.
Enter the following command to get the beautiful figure 3.
> Y, z <= peaks (30 );
> Surfl (x, y, z) % curved surface with brightness
> Shading interp % interpolation and color
> Colormap pink % single color Curved Surface
> Grid, xlabel ('x-axis '), ylabel ('Y-axis'), zlabel ('z-axis ')
> Title ('surfl of peak ')
Iv. Automatic Control System Simulation
In the command window (MATLAB command window), type SIMULINK, and the (Simulink) window appears. In the past, it was very difficult to solve the system simulation problem. You only need to drag the mouse in the chain to solve the problem easily.
(Simulink) system model library 4:
Sources (Input Source) sinks (output mode) discrete (Discrete Time Model) linkear (linear link) nonlinear (non-linear link) connections (connection and Interface) extras (other links ).
If you want to create a control system structure diagram, select the/new menu item, and the untiled editing window appears. Double-click the submodule of the model library (such as sources), and The Sources window shown in Figure 5 appears, it includes step FCN, Sin Wave, white noise, clock, constant, Matlab spatial variable, and signal generator icon.
For example, observe the output waveform of the sine function.
Create a structure diagram, copy the source window (Sin Wave) to the untiled editing window, and drag the filter from the sinks (output mode) sub-module to the unitled editing window, click the output end (triangle) of the Start module with the mouse, and then drag the mouse. A straight line with an arrow appears. Pull the arrow to the input end of the end module and release the mouse key, connect the two modules. Select the simulation/start option in the unitled editing window, and you can double-click the view filter (6) in the structure diagram ).
V. online Internet
The software was developed by Mathworks. (You can find the software information at www.mathworks.com/and download the corresponding document ). You can also send E-mail: suport @ math works.com for technical support.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.