
Chau Chemometrics From Basics to Wavelet Transform
.pdf
|
|
|
appendix |
|
|
|
289 |
|
400 |
|
|
|
|
|
|
|
|
350 |
|
|
|
|
|
|
|
|
300 |
|
|
|
|
|
|
|
|
250 |
|
|
|
|
|
|
|
|
200 |
|
|
|
|
|
|
|
|
150 |
|
|
|
|
|
|
|
|
100 |
|
|
|
|
|
|
|
|
50 |
|
|
|
|
|
|
|
|
0 |
2 |
4 |
6 |
8 |
10 |
12 |
14 |
16 |
0 |
Figure A.12. A plot of the ninth column vector (contains 16 elements) of the matrix B1.
Then, we enlarge the order of the matrix and key in the following statements:
>B=[A A’;1.2*A sqrt(A)] >B1=[B 3*B’;2.1*B B 2]
Finally, we have a matrix of order 16 × 16. If we key in
>plot(B1(:,9))
then Figure A.12 is generated. If we type the following statements, such as
>subplot(221),plot(B1(:,9),’ -’) >hold
the command hold retains the current graph so that subsequent plotting commands add to the graph:
>subplot(222),plot(B1(:,10),’o−’) >subplot(223),plot(B1(:,11),’+−’) >subplot(224),plot(B1(:,11),’.−’)
Then, Figure A.13 will appear on the screen.
If we key in the statement
>bar(B1(:,6))
we will obtain Figure A.14.
To obtain the contour plot of this data matrix, we can simply utilize the following statement.
>contour(B1)


appendix |
291 |
16
14
12
10
8
6
4
2
2 |
4 |
6 |
8 |
10 |
12 |
14 |
16 |
Figure A.15. A contour plot of B1.
500
400
300
200
100
0
20
15 |
20 |
|
10 |
15 |
|
10 |
||
5 |
||
5 |
||
|
||
0 |
0 |
Figure A.16. A 3D mesh plot of B1.
292 |
appendix |
For these above plots (Figs. A.12--A.16), we can still use functions such as title, xlabel, ylabel, and axis, to customize the plot such as adding a title, axis range, axis label, or other feature. In summary, the plotting functions in MATLAB are very convenient to use and make visualization of the data and results much easier and simpler.
