background preloader

MATLAB

Facebook Twitter

Octave - Special Matrices. Go to the first, previous, next, last section, table of contents.

Octave - Special Matrices

Octave provides a number of functions for creating special matrix forms. In nearly all cases, it is best to use the built-in functions for this purpose than to try to use other tricks to achieve the same effect. Special Utility Matrices The function eye returns an identity matrix. If invoked with a single scalar argument, eye returns a square matrix with the dimension specified. GNU Octave - Matrix Factorizations. The Schur decomposition is used to compute eigenvalues of a square matrix, and has applications in the solution of algebraic Riccati equations in control. schur always returns s = u' * a * u where u is a unitary matrix (u'* u is identity)

GNU Octave - Matrix Factorizations

Octave Examples for Solving Linear Algebra Equations. MATLAB Graphics. MATLAB graphics can help you see the big picture in your data.

MATLAB Graphics

It's easy to plot functions or scattered data, to sketch geometric models, to draw contour maps or 3D "mountain" plots, and to make animations. We will quickly introduce some of the MATLAB graphics commands that will be most useful in scientific computing. Simple XY graphics We assume that the quantity Y is a function of X, or is related to X in some way. We wish to display a plot that indicates this relationship. If we have an explicit formula, Y = F(X), the appropriate command is FPLOT, as in this example: fplot ( 'x .* sin(x)', [ 0, 10*pi ] ) The formula must be enclosed in single quotes, and the variable is always called X. Figure 1: A Graph Created by FPLOT. SC - powerful image rendering. SC is a useful function for displaying rich image data, of use to anyone wishing to visualize and save 2D data in ways beyond that which MATLAB built-in functions allow.

SC - powerful image rendering

This function can be used in place of IMAGE, IMAGESC and IMSHOW, but does so much more. It is fast and displays images as they should be - correct aspect ratio, integer magnification, no axes. In addition, it can return the image as an output variable - useful for saving to disk, texture mapping surfaces, and post-rendering manipulation such as overlaying/combining two or more images. How to Customize and Improve MATLAB Figures for Publication. In this post I will be showing how to produce a publication quality figure using MATLAB (2007a).

How to Customize and Improve MATLAB Figures for Publication

To fully appreciate the content presented here you will need some working knowledge of MATLAB, meaning that you should know how to create a basic plot. If you need some help in this department you can reference this Guide from MathWorks. But, if you’re ready to create a publication quality figure (i.e., one that doesn’t look like it was made in Excel), then keep reading. Suppose I am raising two different species of fruit flies in my lab, and once a day for 10 days I measure the size of both populations and record the numbers in two vectors called Species1 and Species2. Now I want to visually compare the growth of the two populations over the 10 days so I use the following basic plotting commands h1 = plot( Days, Species1 ); hold on; h2 = plot( Days, Species2 ); How do I start or stop the MathWorks FLEXnet license manager? Solution: The license manager can be started or stopped using the following methods: For Windows license manager installlations: ========== Option 1: Using LMTOOLS.exe:

How do I start or stop the MathWorks FLEXnet license manager?

Write image to graphics file - MATLAB. Write image to graphics file Syntax Description example imwrite(A,filename) writes image data A to the file specified by filename, inferring the file format from the extension. imwrite creates the new file in your current folder.

Write image to graphics file - MATLAB

The bit depth of the output image depends on the data type of A and the file format. If A is of data type uint8, then imwrite outputs 8-bit values.If A is of data type uint16 and the output file format supports 16-bit data (JPEG, PNG, and TIFF), then imwrite outputs 16-bit values. If A contains indexed image data, you should additionally specify the map input argument. Creating Movies in MATLAB. Carl Scarrott This set of instructions detail how to create movies in MATLAB 5.1, convert them to the standard movie format MPEG and how to play them.

Creating Movies in MATLAB

Limited knowledge of MATLAB or the MPEG format is assumed. This code has not been verified for any other MATLAB version. How to create MATLAB movies 1) Open MATLAB figure window: >> fig1=figure(1); 2) Resize the figure window to size of movie required. 3) Record the size of the plot window: >> winsize = get(fig1,'Position'); 4) Adjust size of this window to include the whole figure window (if you require the axes, title and axis labels in the movie): >> winsize(1:2) = [0 0]; 5) Set the number of frames: >> numframes=16; MATLAB GUI Tutorial - For Beginners.

Why use a GUI in MATLAB? The main reason GUIs are used is because it makes things simple for the end-users of the program. If GUIs were not used, people would have to work from the command line interface, which can be extremely difficult and fustrating. Imagine if you had to input text commands to operate your web browser (yes, your web browser is a GUI too!). It wouldn’t be very practical would it? Importing Text Data Files - MATLAB & Simulink Example. You can import text files into MATLAB® both interactively and programmatically.

Importing Text Data Files - MATLAB & Simulink Example

To import data interactively, use the Import Tool. You can generate code to repeat the operation on multiple similar files. The Import Tool supports text files, including those with the extensions .txt, .dat, .csv, .asc, .tab, and .dlm. These text files can be nonrectangular, and can have row and column headers, as shown in the following figure. How to parse a string? (Simple question) - comp.soft-sys.matlab.