Читать книгу Applied Numerical Methods Using MATLAB - Won Y. Yang - Страница 15

1.1.1 Input/Output of Data from MATLAB Command Window

Оглавление

MATLAB remembers all input data in a session (anything entered through direct keyboard input or running a script file) until the command ‘ clear()’ is given or you exit MATLAB.

One of the many features of MATLAB is that it enables us to deal with the vectors/matrices in the same way as scalars. For instance, to input the matrices/vectors,


type the following statements in the MATLAB Command window:

>A=[1 2 3;4 5 6] A= 1 2 3 4 5 6 >B=[3;-2;1]; %put the semicolon at the end of the statement to suppress the result printout onto the screen >C=[1 -2 3 -4]

At the end of the statement, press <Enter> key if you want to check the result of executing the statement immediately. Otherwise, type a semicolon ‘;’ before pressing <Enter> key so that the Command window will not be overloaded by a long display of results.

Applied Numerical Methods Using MATLAB

Подняться наверх