First
Session
Common mathematical software includes Maple, Mathematica, Matlab and others; common large statistical software includes SAS, SPSS and others. Today, we will briefly introduce some Matlab functions, application areas, and its development history.Matlab has five general functions: numerical computation (Numeric), symbolic computation (Symbolic) (When requesting Matlab to perform symbolic computation, it requests Maple to compute and return the result to the Matlab command window), data visualization (Graphic), unified processing of data graphics and text (Notebook), and modeling and simulation visualization (Simulink).Matlab is widely used in various fields such as linear algebra, matrix analysis, numerical and optimization, mathematical statistics and stochastic signal analysis, circuit and system, system dynamics, signal and image processing, control theory analysis and system design, process control, modeling and simulation, communication systems, and financial engineering.MATLAB was launched by the American company Mathworks in 1984. The software has three main features: first, powerful functions; second, user-friendly interface and natural language; third, high openness(Mathworks has released more than 30 application toolboxes).
❂ Command line editing
❂ Introductory demonstration
❂ Help
❂ Simple matrix input
❂ Statements and variables
❂ Data structures: vectors, matrices, structure arrays, and cell arrays
❂ Mathematical operations and functions
❂ Plotting commands
After starting Matlab , you can start working with Matlab . Since Matlab is an interactive language, entering commands at any time will immediately yield results.2*sin(0.3*pi)/(1+sqrt(5)) ↵
ans=0.5000 (ans is a reserved Matlab string that indicates the return result of the previous expression, used as the default variable name for results.)
intro ↵ demo ↵
① help ↵ % General help overviewhelp elfun ↵ % Help information about basic functionshelp exp ↵ % Detailed information about the exponential function exp② lookfor command When looking for a command with a certain function but not knowing the exact name, the help function is insufficient, lookfor can search for a set of related commands based on complete or incomplete keywords provided by the user. lookfor integral ↵ % Find commands related to integrationlookfor fourier ↵ % Find commands that can perform Fourier transforms③ Hypertext format help files In Matlab, help information about a function can be provided in hypertext format using the doc command, such as: doc ↵doc doc ↵doc eig ↵ % eig finds the eigenvalues and eigenvectors of a matrix④ PDF help files
① To directly input a matrix, separate matrix elements with spaces or commas; matrix rows are separated by semicolons “;”, and the entire matrix is enclosed in square brackets “[ ]”.
A=[1,2,3;4,5,6;7,8,9] ↵Note: After executing the command, the matrix A is saved in the Matlab workspace for later use. If the user does not use the clear command to remove it, or reassign it, then the matrix will remain in the workspace until the Matlab command window is closed.② Row-wise input of the matrixA=[1,2,34,5,67,8,9]
Journal of Nanjing University of Information Science and Technology