Читать книгу Applied Numerical Methods Using MATLAB - Won Y. Yang - Страница 14
1.1 Basic Operations of MATLAB
ОглавлениеMATLAB is a high‐level software package with many built‐in functions that make the learning of numerical methods much easier and more interesting. In this section, we will introduce some basic operations that will enable you to learn the software and build your own programs for problem solving. In the workstation environment, you type “matlab” to start the program, while in the PC environment, you simply double‐click the MATLAB icon.
Once you start the MATLAB program, a Command window will open with the MATLAB prompt ≫. On the command line, you can type MATLAB commands, functions together with their input/output arguments, the names of script files containing a block of statements to be executed at a time or functions defined by users. The MATLAB program files must have the extension name ***.m to be executed in the MATLAB environment. If you want to create a new M‐file or edit an existing file, you click File/New/M‐file or File/Open in the top left corner of the main menu, find/select/load the file by double‐clicking it, and then begin editing it in the Editor window. If the path of the file you want to run is not listed in the MATLAB search path, the file name will not be recognized by MATLAB. In such cases, you need to add the path to the MATLAB‐path list by clicking the menu ‘Set_Path’ in the Command window, clicking the ‘Add_Folder’ button, browsing/clicking the folder name and finally clicking the SAVE button and the Close button. The lookfor command is available to help you find the MATLAB commands/functions that are related with a job you want to be done. The help command helps you know the usage of a particular command/function. You may type directly in the Command window
>lookfor repeat or >help for
to find the MATLAB commands in connection with ‘repeat’ or to find information about the ‘for loop’