Archive for the ‘Examples’ Category:
Matlab Implementing Linked Lists
Displaying Fully Commented Example Code
Open class code in a popup window — Use this link if you want to see the code for this class annotated with links to descriptive sections. Read More
Tags: addNode, Basic Structure of Constructor Methods, class, Classdef, Comparing Handle and Value Classes, Defining the dlnode Class, disp, Displaying Fully Commented Example Code, dlnode, Handle Class Delete Methods, insert node, Inserting Nodes, matlab, matlab example, matlab node, NamedNode, node, Open class code in a popup window, Open class definition file in the MATLAB editor., The Handle Superclass, Why a Handle Class for Doubly Linked Lists?
Example of Class Definition Syntax
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
Creating the Graph
First define two variables by issuing these statements in the command window. Read More
Creating m-files in Matlab
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
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
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
You have already seen several examples of MATLAB expressions. Here are a few more examples, and the resulting values. Read More