ABSTRACT

There are two types of M-files: script files and function files. In this exercise, you will incrementally develop and debug a script and then a function for making a matrix

diagonally dominant. Create a new M-file, either with the edit command, by selecting the File ► New ► M-file menu item, or by clicking the new-file button:

Type in these lines in the Editor,

f = sum(A, 2) ; A = A + diag(f) ;

and save the file as ddom.m by clicking:

You have just created a MATLAB script file.1 The semicolons are there because you normally do not want to see the results of every line of a script or function.