Saving your Matlab sessions

March 26th, 2010 No Comments   Posted in Examples

Often one wants to save the data or variables to another occasion. Maybe one wants to save the whole Matlab session. This can be done. Commands are put in a m-file but data or variables are stored in a mat-file (binary file) which can be opened with Workspace Browser. First have a look in the workspace to find out how your varables look like. Then save these in a mat-file. Read More

Analysis of Functions, Interpolation, Curve Fitting, Integrals and Differential Equations 2

March 23rd, 2010 No Comments   Posted in Documents

Localize minima and maxima of functions

Let us try to find the local minima and maxima for the function func(x). The interval of interest is [-6 0]. The algorithms are iterative. There are 2 methods to use. The first one decides x in a given interval, and the second one looks for x around an initial guess. To decide the maxima we are looking for an x that minimizes the negative function: -func(x). Read More

Controlling Command Window Input and Output

March 19th, 2010 No Comments   Posted in Documents

The format Function

The format function controls the numeric format of the values displayed. The function affects only how numbers are displayed, not how MATLAB software computes or saves them. Here are the different formats, together with the resulting output produced from a vector x with components of different magnitudes. Read More

Manipulating Matrices

March 13th, 2008 No Comments   Posted in Documents

Matrices and Magic Squares

Matlab MatrisIn MATLAB, a matrix is a rectangular array of numbers. Special meaning is sometimes attached to 1-by-1 matrices, which are scalars, and to matrices with only one row or column, which are vectors. MATLAB has other ways of storing both numeric and nonnumeric data, but in the beginning, it is usually best to think of everything as a matrix. The operations in MATLAB are designed to be as natural as possible. Where other programming languages work with numbers one at a time, MATLAB allows you to work with entire matrices quickly and easily. A good example matrix, used throughout this book, appears in the Renaissance engraving Melancholia I by the German artist and amateur mathematician Albrecht Dürer. Read More

Desktop Tools

March 12th, 2008 No Comments   Posted in Documents

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: Read More

more

March 6th, 2008 No Comments   Posted in Functions

more   Control paged output in command window.
more OFF disables paging of the output in the MATLAB command window.
more ON enables paging of the output in the MATLAB command window.
more(N) specifies the size of the page to be N lines. Read More

diary

March 6th, 2008 No Comments   Posted in Functions

DIARY Save text of MATLAB session.
DIARY filename causes a copy of all subsequent command window input and most of the resulting command window output to be appended to the named file. If no file is specified, the file ‘diary’ is used. Read More