The use of findobj and set for graphics properties

After you create a plot in Matlab, you might need to modify the characteristics of the figure. While many options can be specified during the initial plot command, they can easily be modified later as well using plot handles, and the useful functions of ‘findobj’,’get’ and ‘set’. If you are unclear on some of these commands, or need a refreshers, take a look at our tutorial on plotting .

Continue reading

Introducing our Forums

We just launched our new Forums page on Matlab Geeks.  Because of the large quantity of questions that we receive through email and on our posts, we thought that it would be more productive for you (and easier for us) if these questions saw more public exposure.  If you have a question about Matlab, please post it on our forums.  Additionally, if you know the answer to a question that someone has posted, please answer it.  We hope to build a community of Matlab users on this site which will be mutually beneficial for all of those involved.  To participate in the forums, just click this link or the “Forums” link under the header.

How to Blur an Image with a Fourier Transform in Matlab – Part I [Revised*]

In the last post, many moons ago, I introduced the 2-D FFT and discussed the magnitude and phase components of the spatial Fourier domain.  In the next few posts, I would like to describe a concrete application of the 2-D FFT, namely blurring.  Blurring and deblurring are useful image processing techniques that can be used in a variety of fields.  I will explain what blur is mathematically and how it is performed artificially.  In future posts, I’ll go into more depth about what happens in the spatial domain, different types of blur, and some current deblurring technology.

Continue reading

Modeling with ODEs in Matlab – Part 4A

It’s finally time for Part 4! Now that we know how to design and numerically solve simple ODE models it’s time to take a look at how to fit these models to empirical data. It is important to remember that we design models to simulate real behavior. Thus, it is important to be able to tie our ODE equations to the real system we are trying to model. We do this by choosing values for our model parameters that makes the system behave similar to real world behavior. This lesson continues in Part 4B.
Continue reading

Getting user input in MATLAB – the use of input, ginput and inputdlg

Sorry for the delay in postings, but many of us are in the state of transition, whether its school, weddings or work. As a simple tutorial to get back into the swing of things, let’s look at several different ways of requesting user input in your MATLAB programs. While you will often need to display information to the user, you will have to request data from them as well. There are several options available to you, and we will run through many of them here. The most basic of which is the command line based “input”.

Continue reading

Managing Your Path in Matlab – Part II

In the last article I wrote about managing your path in Matlab, I covered some of the functions that deal with the search path, including path, matlabroot, addpath, rmpath and genpath.  These functions provide a solid base for viewing, adding and removing directories from your search path.  In this article, I will explain how to use several more functions that deal with your search path, including functions that make changes which persist after ending your Matlab session. Continue reading

Modeling with ODEs in Matlab – Part 3

Well, I feel like I should apologize for such a long delay between posts. It’s been a crazy summer that has included some vacation time plus an overseas trip to a conference. Regardless, I’m finally back in the swing of things and ready to write up Part 3! To recap: Lesson 1 and Lesson 2 looked at how ODEs are solved numerically and how higher order solutions are more accurate than naive implementations. Today we’ll look at two simulations of living systems (Lotka-Volterra and SIR). Finally, the series will conclude with a post on model fitting and a post about chaotic systems.
Continue reading

Clustering Part 2: K-means clustering

Clustering data is the act of partitioning observations into groups, or clusters, such that each data point in the subset shares similar characteristics to its corresponding members. Cluster analysis is commonly used in fields that utilize data mining, pattern recognition and machine learning. While MATLAB has several clustering tools included in its arsenal, we’ll take a look at the function kmeans in this tutorial. Following classification of n observations into k clusters, we can use binary classification to investigate the sensitivity and specificity of our clustering.

Continue reading