Example of Class Definition Syntax

April 20th, 2010 No Comments   Posted in Examples

Example of Class Definition Syntax

The following code shows the syntax of a typical class definition. This example is not a functioning class because it references functions that it does not implement. The purpose of this section is to illustrate various syntactic constructions. Read More

Specifying a Data Source

April 13th, 2010 No Comments   Posted in Examples

Creating the Graph

First define two variables by issuing these statements in the command window. Read More

Creating m-files in Matlab

March 26th, 2010 No Comments   Posted in Examples

Open an edit window where we can write the command lines. Click on the white sheet in the menu under File or simply write edit in the command window. Alternatively File->New ->M-file. The following is written in the edit window: Read More

Finding maximum and minimum values in arrays

March 26th, 2010 No Comments   Posted in Examples

Let’s write a function file range.m that calculates the difference between the maximum and minimum value in a vector. The file should return a reply. Open an edit window. Create a function file like the one below. Read More

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

Examples of Expressions

March 6th, 2008 No Comments   Posted in Examples

You have already seen several examples of MATLAB expressions. Here are a few more examples, and the resulting values. Read More