Đang chuẩn bị liên kết để tải về tài liệu:
Lecture note Data visualization - Chapter 20
Không đóng trình duyệt đến khi xuất hiện nút TẢI XUỐNG
Tải xuống
This chapter presents the following content: Graphic window, edit window, start button, matrices in matlab, scalar operations, order of operations, array operations, matrix addition, matrix multiplication, number display (scientific notation), script m-files. | Lecture 20 Recap Graphic Window Edit Window Start Button Matrices in MATLAB Scalar Operations Order of Operations Array Operations Matrix Addition Matrix Multiplication Number Display (Scientific Notation) Script M-Files Types of M-files Two types Script Function Script M-file The script can use any variables that have been defined in the workspace, and any variables created in the script are added to the workspace when the script executes A script created in the MATLAB edit window can be executed by selecting the Save and Run icon from the menu bar A script can be executed by typing a file name or by using the run command from the command window No matter how you do it, you can only run an M-file if it is in the current folder Editor/Debugger Window Cell Mode It is a utility that allows the user to divide M-files into sections, or cells, that can be executed one at a time This feature is particularly useful as develop MATLAB ® programs are developed To activate the cell mode, select | Lecture 20 Recap Graphic Window Edit Window Start Button Matrices in MATLAB Scalar Operations Order of Operations Array Operations Matrix Addition Matrix Multiplication Number Display (Scientific Notation) Script M-Files Types of M-files Two types Script Function Script M-file The script can use any variables that have been defined in the workspace, and any variables created in the script are added to the workspace when the script executes A script created in the MATLAB edit window can be executed by selecting the Save and Run icon from the menu bar A script can be executed by typing a file name or by using the run command from the command window No matter how you do it, you can only run an M-file if it is in the current folder Editor/Debugger Window Cell Mode It is a utility that allows the user to divide M-files into sections, or cells, that can be executed one at a time This feature is particularly useful as develop MATLAB ® programs are developed To activate the cell mode, select Cell -> Enable Cell Mode from the menu bar in the edit window Once the cell mode has been enabled, the cell toolbar appears To divide M-file program into cells, create cell dividers by using a double percentage sign followed by a space To name the cell, just add a name on the same line as the cell divider: %% Cell Name Continued . It’s important to include the space after the double percentage sign (%%). If don’t, the line is recognized as a comment, not a cell divider Once the cell dividers are in place, if cursor is positioned anywhere inside the cell, the entire cell turns pale yellow Now use the evaluation icons on the cell toolbar to evaluate a single section, evaluate the current section and move on to the next section, or evaluate the entire file Also on the cell toolbar is an icon that lists all the cell titles in the M-file Continued . By dividing the program into cells, it was possible to work on each problem separately Be sure to save any M-files developed this way by .