Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống
1
/ 29 trang
THÔNG TIN TÀI LIỆU
Thông tin cơ bản
Định dạng
Số trang
29
Dung lượng
240,83 KB
Nội dung
Installing on Linux 2-7 Installing on Linux Note The Student Version of MATLAB & Simulink for the Linux platform is only available in the US and Canada. System Requirements Note For the most up-to-date information about system requirements, see the system requirements page, available in the products area at the MathWorks Web site (www.mathworks.com). MATLAB and Simulink • Intel-based Pentium, Pentium Pro, Pentium II, Pentium III, or AMD Athlon personal computer • Linux 2.2.x kernel - glibc 2.1.x (2.1.2 or higher recommended) - gcc 2.95.2 (gcc, g++, g77) - xFree86 3.3.x (3.3.6 or higher recommended) • X Windows (X11R6) • 110 MB free disk space for MATLAB, Simulink, and Symbolic Math Toolbox • 64 MB memory, additional memory strongly recommended • 64 MB swap space • CD-ROM drive for installation and online documentation • 8-bit graphics adapter and display (for 256 simultaneous colors) • Netscape Navigator 4.0 or higher is required. Adobe Acrobat Reader is required to view and print the MATLAB online documentation that is in PDF format. 2 Installation 2-8 MEX-Files MEX-files are dynamically linked subroutines that MATLAB can automatically load and execute. They provide a mechanism by which you can call your own C and Fortran subroutines from MATLAB as if they were built-in functions. For More Information “External Interfaces/API” provides information on how to write MEX-files. “External Interfaces/API Reference” describes the collection of API functions. Both of these are available from Help. If you plan to build your own MEX-files, you need an ANSIC C compiler (e.g., the GNU C compiler, gcc). Note For an up-to-date list of all the compilers supported by MATLAB, see the MathWorks Technical Support Department’s Technical Notes at: http://www.mathworks.com/support/tech-notes/v5/1600/1601.shtml Installing MATLAB The following instructions describe how to install the Student Version of MATLAB & Simulink on your computer. Note It is recommended that you log in as root to perform your installation. Installing the Software To install the Student Version: 1 If your CD-ROM drive is not accessible to your operating system, you will need to create a directory to be the mount point for it. mkdir /cdrom 2 Place the MathWorks product CD into the CD-ROM drive. Installing on Linux 2-9 3 Execute the command to mount the CD-ROM drive on your system. For example, # mount -t iso9660 /dev/cdrom /cdrom should work on most systems. If your /etc/fstab file has a line similar to /dev/cdrom /cdrom iso9660 noauto,ro,user,exec 0 0 then nonroot users can mount the CD-ROM using the simplified command $ mount /cdrom Note If the exec option is missing (as it often is by default, for security reasons), you will receive a “Permission denied” error when attempting to run the install script. To remedy this, either use the full mount command shown above (as root) or add the exec option to the file /etc/fstab. 4 Move to the installation location using the cd command. For example, if you are going to install into the location /usr/local/matlab6, use the commands cd /usr/local mkdir matlab6 cd matlab6 Subsequent instructions in this section refer to this directory as $MATLAB. 5 Run the CD install script. /cdrom/install_glnx86.sh The welcome screen appears. Select OK to proceed with the installation. Note If you need additional help on any step during this installation process, click the Help button at the bottom of the dialog box. 2 Installation 2-10 6 Accept or reject the software licensing agreement displayed. If you accept the terms of the agreement, you may proceed with the installation. 7 The MATLAB Root Directory screen is displayed. Select OK if the pathname for the MATLAB root directory is correct; otherwise, change it to the desired location. 8 The system displays your license file. Press OK. Installing on Linux 2-11 9 The installation program displays the Product Installation Options screen, which is similar to this. The products you are licensed to install are listed in the Items to install list box. The right list box displays the products that you do not want to install. To install the complete Student Version of MATLAB & Simulink, you must install all the products for which you are licensed (MATLAB, MATLAB Toolbox, MATLAB Kernel, Simulink, and Symbolic Math Toolbox). Select OK. 2 Installation 2-12 10 The installation program displays the Installation Data screen. Specify the directory location in your file system for symbolic links to the matlab and mex scripts. Choose a directory such as /usr/local/bin. You must be logged in as root to do this. Select OK to continue. 11 The Begin Product Installation screen is displayed. Select OK to start the installation. After the installation is complete, the Product Installation Complete screen is displayed, assuming your installation is successful. Select Exit to exit from the setup program. 12 You must edit the docopt.m M-file located in the $MATLAB/toolbox/local directory to specify the path to the online documentation (Help). For example, if /cdrom is the path to your CD-ROM drive, then you would use /cdrom/help. To set the path using this example, change the lines in the if isunix block in the docopt.m file to if isunix % UNIX % doccmd = ''; % options = ''; docpath = '/cdrom/help'; The docopt.m file also allows you to specify an alternative Web browser or additional initial browser options. It is configured for Netscape Navigator. Installing on Linux 2-13 13 If desired, customize any MATLAB environment options. For example, to include default definitions or any MATLAB expressions that you want executed every time MATLAB is invoked, create a file named startup.m in the $MATLAB/toolbox/local directory. MATLAB executes this file each time MATLAB is invoked. 14 Start MATLAB by entering the matlab command. If you did not set up symbolic links in a directory on your path, type $MATLAB/bin/matlab. Post Installation Procedures Successful Installation If you want to use the MATLAB Application Program Interface, you must configure the mex script to work with your compiler. Also, some toolboxes may require some additional configuration. For more information, see “Installing Additional Toolboxes” later in this section. Unsuccessful Installation If MATLAB does not execute correctly after installation: 1 Check the “R12 Release Notes” for the latest information concerning installation. This document is accessible from Help. 2 Repeat the installation procedure from the beginning but run the CD install script using the -t option. /cdrom/install_glnx86.sh -t For More Information The MATLAB Installation Guide for UNIX provides additional installation information. This manual is available from Help. Installing Additional Toolboxes To purchase additional toolboxes, visit the MathWorks Store at (www.mathworks.com/store). Once you purchase a toolbox, it is downloaded to your computer. When you download a toolbox on Linux, you receive a tar file (a standard, compressed formatted file). 2 Installation 2-14 To install the toolbox, you must: 1 Place the tar file in $MATLAB and un-tar it. tar -xf filename 2 Run install. After you successfully install the toolbox, all of its functionality will be available to you when you start MATLAB. Note Some toolboxes have ReadMe files associated with them. When you download the toolbox, check to see if there is a ReadMe file. These files contain important information about the toolbox and possibly installation and configuration notes. To view the ReadMe file for a toolbox, use the whatsnew command. Accessing the Online Documentation (Help) Access the online documentation (Help) directly from your documentation CD. 1 Place the documentation CD in your CD-ROM drive and mount it. 2 Select Full Product Family Help from the Help menu in the MATLAB Command Window. You can also type helpbrowser at the MATLAB prompt. The Help browser appears. Installing on Linux 2-15 2 Installation 2-16 [...]... see the corresponding topics under “Development Environment” in the MATLAB documentation, which is available online 3 -2 Starting and Quitting MATLAB Starting and Quitting MATLAB Starting MATLAB On a Microsoft Windows platform, to start MATLAB, double-click the MATLAB shortcut icon on your Windows desktop On Linux, to start MATLAB, type matlab at the operating system prompt Note On the Microsoft Windows... to start MATLAB On both platforms, the documentation CD must be in your CD-ROM drive to access the online documentation After starting MATLAB, the MATLAB desktop opens – see MATLAB Desktop” on page 3-4 You can change the directory in which MATLAB starts, define startup options including running a script upon startup, and reduce startup time in some situations Quitting MATLAB To end your MATLAB session,... Introduction 3 -2 Starting and Quitting MATLAB 3-3 MATLAB Desktop Desktop Tools 3-4 3 -6 Other Development Environment Features 3-15 3 Development Environment Introduction This chapter provides a brief introduction to starting and quitting MATLAB, and the tools and functions that help you to work with MATLAB variables and files For... situations Quitting MATLAB To end your MATLAB session, select Exit MATLAB from the File menu in the desktop, or type quit in the Command Window To execute specified functions each time MATLAB quits, such as saving the workspace, you can create and run a finish.m script 3-3 3 Development Environment MATLAB Desktop When you start MATLAB, the MATLAB desktop appears, containing tools (graphical user interfaces)... This section provides an introduction to MATLAB s desktop tools You can also use MATLAB functions to perform most of the features found in the desktop tools The tools are: • “Command Window” on page 3 -6 • “Command History” on page 3-7 • “Launch Pad” on page 3-8 • “Help Browser” on page 3-8 • “Current Directory Browser” on page 3-11 • “Workspace Browser” on page 3- 12 • “Array Editor” on page 3-13 • “Editor/Debugger”... enter variables and run functions and M-files For more information on controlling input and output, see “Controlling Command Window Input and Output” on page 4 -28 Type functions and variables at the MATLAB prompt MATLAB displays the results 3 -6 Desktop Tools Command History Lines you enter in the Command Window are logged in the Command History window In the Command History, you can view previously... Search Path To determine how to execute functions you call, MATLAB uses a search path to find M-files and other MATLAB- related files, which are organized in directories on your file system Any file you want to run in MATLAB must reside in the current directory or in a directory that is on the search path By default, the files supplied with MATLAB and MathWorks toolboxes are included in the search path... Access MATLAB s numeric computation and visualization software from within a word processing environment (Microsoft Word) 3-15 3 Development Environment 3- 16 4 Getting Started Matrices and Magic Squares 4 -2 Expressions 4-10 Working with Matrices 4-14 More About Matrices and Arrays 4-18 Controlling Command Window Input and Output 4 -28 4 Getting... commas • Use a semicolon, ; , to indicate the end of each row • Surround the entire list of elements with square brackets, [ ] To enter Dürer’s matrix, simply type in the Command Window A = [ 16 3 2 13; 5 10 11 8; 9 6 7 12; 4 15 14 1] 4-3 ... variable to see and change its contents in the Array Editor 3- 12 Desktop Tools To delete variables from the workspace, select the variable and select Delete from the Edit menu Alternatively, use the clear function The workspace is not maintained after you end the MATLAB session To save the workspace to a file that can be read during a later MATLAB session, select Save Workspace As from the File menu, . (www.mathworks.com). MATLAB and Simulink • Intel-based Pentium, Pentium Pro, Pentium II, Pentium III, or AMD Athlon personal computer • Linux 2. 2.x kernel - glibc 2. 1.x (2. 1 .2 or higher recommended) - gcc 2. 95 .2. /usr/local /matlab6 , use the commands cd /usr/local mkdir matlab6 cd matlab6 Subsequent instructions in this section refer to this directory as $MATLAB. 5 Run the CD install script. /cdrom/install_glnx 86. sh The. xFree 86 3.3.x (3.3 .6 or higher recommended) • X Windows (X11R6) • 110 MB free disk space for MATLAB, Simulink, and Symbolic Math Toolbox • 64 MB memory, additional memory strongly recommended • 64