Using the Editor and Debugger with Classes

April 21st, 2010 No Comments   Posted in Documents

Referring to Class Files

Define classes in M-files just like scripts and functions. To use the editor or debugger with a class file, use the full class name. For example, suppose the file for a class, myclass.m is in the following location: Read More

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

Adding Text Annotations to Graphs

April 18th, 2010 No Comments   Posted in Documents

What Are Text Annotations?

Text annotations are boxes containing text strings that you compose. The box can have a border and a background, or be invisible. The text can be in any installed text font, and can include TeX or LaTeX markup. You can add free-form text annotations anywhere in a MATLAB figure to help explain your data or bring attention to specific points in your data sets. Read More

MATLAB Commands

April 12th, 2010 No Comments   Posted in Documents

Basic Command Syntax

A simple MATLAB command computes the result of the expression to the right of the equals sign and assigns the value of the result to the output variable at the left. Examples of simple MATLAB commands are 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

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

bsxfun

December 6th, 2009 No Comments   Posted in Functions

bsxfun – Apply element-by-element binary operation to two arrays with singleton expansion enabled
Syntax Read More