![]() |
Information
Technology Services Centre |
1. Introduction
MATLAB is a technical computing environment for high-performance numeric computation and visualization. MATLA integrates numerical analysis, matrix, computation, signal processing, and graphics in an easy-to-useenvironment where problems and solutions are expressed just as they are written mathematically - without traditional programming.
The only data type in MATLAB is the matrix, a rectangular array of possibly complex floating-point values, which need not be dimensioned, and whose size and shape can vary dynamically.
MATLAB for UNIX, Version 7.1, available on the General-purpose UNIX Server (Logic).
2. Access to Matlab on 'Logic'
'Logic' is accessible via ssh at logic.itsc.cuhk.edu.hk. Refer to ITSC Quick Start Guide WKS003 Use of General-purpose UNIX Server (Logic) for the access details. After successful connection,
4. Matlab Statements
MATLAB is an expressing language. Entering data or statements is simple, it is frequently of the form: variable = expression.
>> ml = [1,2,3;4,5,6] (create a 2 x 3 matrix ml)
m1
= (MATLAB shows the result by default)
1
2 3
4
5 6
>> result =cos(m1*2);
IF,
ELSE: BREAK:
if expression break
statement(s) (terminates
the
else execution
of for
statement(s) and
while loops)
and
5. Handling With Data File
MATLAB uses and creates several types of files
|
|
|
|
| Definition: | A collection of MATLAB commands | User-defined function to solve user-specific problem. |
| Characteristics: | Null | The word 'function' at the beginning of the first line. |
| Variables: | Global. | Local (variables are passed into the function as local variables). |
| Usage: | Type the script filename and press ? . | Used as function call; e.g. mean is a function, call it as mean (1,2,3). |
|
|
|
| diaryfilename | save session in a disk file, but no graphics, useful for inclusion into documents and reports |
| dir | show current directory |
| typefilename | show file content |
| delete | delete file |
| cd | change directory |
| ! | reset of the input line is issued as a command to the UNIX system |
7. Handling With Graphics/Printing
In order to display graphics in MATLAB, please access from X-terminal, PC-XView, X-window or Macintosh.
MATLAB demonstration:
>> demo
Online documents:
>> help topicIntroduction to MATLAB:
>> introKeyword search through all help entries:
>> lookfor topicDisplay listing of M-files, MAT-files:
>> whatNew features in version 4.2a
>> whatsnewLocate functions and files:
>> which function_nameList directory of variables in memory:
>> who9. References
9.1 Manuals
9.2 Others
For any enquiries, please contact us by:
Website: http://www.cuhk.edu.hk/itsc
Electronic HelpDesk: https://helpdesk.itsc.cuhk.edu.hk/group/matlab-help
Fax: 2603-6946
Phone: 2609-8845 (Hotline Services)
Monday - Thursday 08:45-13:00 14:00-17:30
Friday 08:45-13:00 14:00-17:45
Saturday, Sunday & Public Holiday close