Current location - Education and Training Encyclopedia - Graduation thesis - It doesn't matter which aspect the papers used in matlab are applied to, and it's better not to be published online.
It doesn't matter which aspect the papers used in matlab are applied to, and it's better not to be published online.
The application of the link between Matlab and Word in geotechnical test [2009-03-1615: 47] Free papers, including the data processing link of matlab word notebook in geotechnical test.

Abstract: Matlab is a powerful software for engineering calculation and data analysis, and Word is a powerful word processing software. Through the combination of the two, data visualization can be realized in Word, and illustrations can be easily realized in scientific reports, papers and monographs. Then, by exploring the application process of MATLAB software in geotechnical test data processing, a new data processing software is introduced, which provides a new idea for future test data processing.

Keywords: MatlabWord notebook; data processing

1 Introduction

As we all know, Microsoft Word software has powerful word processing function and has been widely used in various fields of scientific research. However, Word itself has no data manipulation function, and its drawing function is limited. Matlab is a set of high-performance numerical calculation and visualization software developed by MathWorks. It is a highly integrated system, integrating scientific calculation, image processing and sound processing, with high programming efficiency. This paper will discuss how to combine the numerical processing and drawing functions of Matlab with Word, expand the functions of Word, and make them work in harmony (taking Matlab 6.5 and Word 2002 as examples).

In the data processing of geotechnical test, it is often necessary to describe the test results by graphic method, and then get the required test parameters by looking up the map. For example, in the particle analysis test of soil, it is necessary to draw a grading curve to determine the limit particle size and effective particle size of soil, so as to calculate the uneven coefficient and curvature coefficient of soil; In the compaction test of soil, it is necessary to use compaction curve to reflect the test results, and find out the maximum dry density and optimum water content by looking up the map; In the triaxial test of soil, it is necessary to draw a Moore circle to determine the cohesion C and internal friction angle φ of soil. In the past, the processing method was to draw by hand or use the chart function in EXCEL tools, but it was limited to its graphic function and could not be used for numerical calculation, and the corresponding numerical calculation needed to be done manually. MATLAB not only provides graphic function, but also adds calculation function, which further simplifies data processing.

The link between MATLAB and Word

2. 1 install Matlab notebook

There are two methods: one is to install from Matlab system: firstly, start Matlab 6.5 and run the function command "notebook -setup" in the command window (with a space in the middle). After entering the command window, the following prompt will appear:

& gt& gt Notebook-Settings

Welcome to use the utility program for setting up Matlab notebook to interface MATLAB with Microsoft Word (welcome to create the public program of MATLAB notebook and Word).

Select your version of Microsoft Word: (Select your version of Word)

[ 1]Microsoft Word 97

[2] Microsoft Word 2OOO

[3] Microsoft Word 2002(XP)

[4] Exit without making any changes.

Microsoft word version: 3 (we choose 3 here)

Then, the following prompt will appear in the command window:

Notebook setup is complete. (Matlab notebook installation completed)

Another method is to copy the file c: \ matlab6p5 \ notebook \ PC \ m _ book.dot directly to the directory c: \ program files \ Microsoft office \ office10 \ 2052.

The method of mutual call between Matlab and Word: (It can also be used as a test method for whether the installation is successful)

(1) Calling Word in Matlab: directly enter the notebook command in the Matlab command window, and the system will automatically start Word, and a notebook bar will be added in its main menu bar.

(2) Calling Matlab in Word: Start Word, then select New under the File menu, select common template in New Template, and then select M-book document. Press OK, and the system will automatically start Matlab.

2.2 Instructions for notebook use

In a sense, the notebook is the M-book in Word. Notebook interacts with Matlab through dynamic link library, and the basic unit of interaction is called cell (Cel 1). The information exchanged is called "cell (group)". M-book needs to form cells (groups) from Matlab commands or statements input in Word, transmit them to Matlab for running, and then send the output results back to M-book in the form of cells (groups). In this way, the calculation results and simulated graphics will appear under the input cells (groups) in Word.

"Input cell" is a command transmitted by M-book to Matlab, which can be multi-line, a command contained in text or a Matlab program. "output cell" is the calculation result returned by Matlab to M-book. A "self-activating unit" is an input unit defined by the [Define AutoInit Cel 1] command in the [Notebook] menu. It is different from the input cell in that every time you open the M-book, it will automatically run the active cell instead of the input cell. Autologous cells are marked in dark blue, while input cells are marked in green. "Cell Group" is a multi-line input cell or active cell, which contains several Matlab commands.

Generate Input Cells: In Word, enter instructions in text format, then select this part and use Define Input Cells 1 in the Notebook menu, so that M-book will generate "input cells" from ordinary text, enclose instructions in black brackets, and the instructions will become green fonts.

Then, use the "Evaluate Cells" option in the "Notebook" menu to transfer the generated cells to Matlab for operation, and the operation results will automatically return to the M-book, and the operation results will be marked in blue. Cell population and cell operation are similar.

Notebook also provides a Calc Zone, which divides M-book into several independent parts, including: text describing a specific problem or specific operation, input cells and output cells. When defining the calculation area, Notebook separates this part from other parts of the M-book, and the definition, operation and input of its cells are similar.

The notebook also provides the cycle operation of cells. First, select the input cell to be repeated (it must be a green cell), and then select the [Evaluate Loop] option in the [Notebook] menu. The functions of the [Notebook] menu are shown in table l below.

Table 1 notebook menu function

menuitem

keyboard shortcuts

function

Define input cells

Alt+I

Define input cells

Define automatic unit

Alt+A

Define autogenous cells

Define the calculation area

Alt+Z

Define the calculation area

Undefined cell

Alt+U

Release cells; Convert to text

Clear the selected output cells.

Alt+P

Deletes all output cells from the selected space.

Grouping cell

Alt+G

Produce cell population

Ungroup cells

;

Convert cell population into input cells and autogenous cells.

Hide (show) cell markers

Alt+C

Show (hide) parentheses in generative cells.

Toggles the graphical output of cells.

;

Whether to embed the generated graphics.

Evaluate mobile books

Alt+R

Run all input cells in the entire M-book.

Evaluation cycle

Alt+L

Run the input cell multiple times.

Evaluation cell

Ctrl+Enter

Run input cell

Evaluation calculation area

Alt+Enter

Running calculation area

Put MATLAB in front.

Alt+F

Adjust the MATLAB command window to the foreground.

Notebook options …

Alt+O

Format digital and graphic output

Application of MATLAB software in geotechnical test

3. 1 Formation of graphics

Particle analysis test is a method to determine the percentage of various particle groups in dry soil to the total soil mass, so as to understand the particle size distribution, provide soil classification, roughly judge the engineering properties of soil and select materials. The test results need to provide grading curve, unevenness coefficient and curvature coefficient. Table 2 shows the measured values of a set of particle analysis tests:

Table 2 Gradation of Soil Materials

Particle diameter (mm)

0. 1

0.05

0.02

0.0 1

0.005

0.00 1

Particle content (%)

100

94.68

72. 10

4 1.82

27. 13

1 1.69

When using MATLAB software to process data, we first call the existing data file, attach the particle size array to X and the corresponding percentage array to Y, take the logarithm of the particle size, and establish the cubic spline function relationship between the logarithm of the particle size and the percentage less than the particle size. Within the given particle size range, the particle size array is refined, and the corresponding percentage of the given logarithmic particle size is solved and interpolated. Then, the particle diameter is interpolated by using the graphic function of MATLAB. The operation process is as follows: after installing Notebook, start Word, then select New from the File menu, select common template from the New Template, and then select M-Book document. Press OK, Matlab will start automatically and Notebook can be used.

Enter the following in the m-book:

x =[0. 1 0.05 0.02 0.0 1 0.005 0.00 1];

y =[ 100 94.68 72. 10 4 1.82 27. 13 1 1.69];

x 1 = log 10(x);

y 1 = y;

xx =-3.0:0.04:- 1;

pp=spline(x 1,y 1); ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; % cubic spline interpolation

y2=ppval(pp,xx); ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; % piecewise polynomial estimation function

x2= 10。 ^xx;

semilogx(x,y,'-',x2,y2);

Xlabel ('particle diameter (mm)')

Ylabel ("less than% of a certain particle size)

Title ("Gradient Curve")

Select these words, select Define Input Cel 1 from the Notebook menu, and then select Evaluate Cel 1 to draw the figure as shown in figure 1 in Word.

;

3.2 Parameter calculation

Through the above process, the gradation curve of soil material is generated, and the parameters provided by the test need to be calculated. Use the function function provided by MATLAB software to re-establish the functional relationship between the percentage content less than a certain particle size and the particle size logarithm, that is, the inverse function of the original function, solve the particle size logarithm value corresponding to the given content, restore it, calculate it separately, and then use the formula:

Calculate non-uniformity coefficient and curvature coefficient.

Enter the following in the manual:

Pp = spline (y2, xx);

x 10=ppval(pp, 10);

d 10= 10^x 10

x30=ppval(pp,30);

d30= 10^x30

x60=ppval(pp,60);

d60= 10^x60

Cu=d60/d 10

Cc=d30^2/ (d60*d 10)

Select these words, select Define Input Cel 1 from the Notebook menu, and then select Evaluate Cel 1 to directly calculate the output results in Word: d 10=9.4293e-004, d30 =0.0063, D60.

Through the above process, using MATLAB programming, the data processing process of soil particle analysis test is completed in Word.

4 Conclusion and explanation

Combining Matlab 6.5 with Word, making full use of their advantages and realizing the "powerful combination" of software will provide great convenience for us to write scientific and technological reports, papers, monographs and teaching plans. Programs, calculation results and simulated graphics can all be in Word documents at the same time, calculation commands can be modified at any time, and graphics can be calculated and drawn at any time. Of course, it also has some shortcomings, such as the mouse's graphic interactive instruction can't run in the M-book document, and the Matlab instruction runs slowly in the M-book document.

The most important feature of MATLAB is that it is easy to expand. It allows users to create their own M files to complete the specified functions, thus forming a toolbox suitable for other fields. For an engineer working in a specific field, not only the functions provided by MATLAB and basic toolbox functions can be used, but also special functions can be constructed conveniently, thus greatly expanding its application scope. MATLAB language has powerful graphics and calculation functions, especially in matrix operation. The contents involved in this article are just a few of them. If a digital simulation system can be established to simulate geotechnical tests, it will have a great impact.