There are two types of data scientists – those who cluster and those who don’t

Today, we are lucky to have Jesse Marshall as a guest blogger on data analysis. Jesse is a PhD student at Stanford, working on analyzing the collective behavior of hundreds of neurons as they process information in the living brain. 

heic1317a

A cluster of galaxies? Or random chance? – Source : spacetelescope.org

Humans have trouble accepting randomness. We search for patterns, trends and correlations in all aspects of life, and we do it for good reason. Identifying patterns lets us learn from our mistakes and predict the future. Clustering algorithms are exploratory data analysis tools used to categorize a set of observations into a few discrete classes, or, clusters, that share common features. Cluster algorithms only need four ingredients: a set of objects,a list of quantitative or qualitative descriptors of these objects, and a metric that you can use to compare these objects, based on their features. Then you try to divide the data into a specified number of clusters and see what happens.

Continue reading

Posted in Intermediate | Tagged , , , , | Leave a comment

Error Handling – Using Try and Catch

Try and Catch! – Source: Image

Typically when using Matlab, if the program encounters some bug, you will hear the system bell and see the dreaded red text show up in the command window. So what do you do if you absolutely need your programs to run without error? Having a program crash is unacceptable. You must implement error handling within your code.

Continue reading

Posted in Advanced | Leave a comment

Variable Scope: Memory Spaces in Matlab

Every variable has a scope or is it the opposite? - Source: Image

Every variable has a scope or is it the opposite? – Source: Image

For this post, we are glad to welcome Nicholas as a contributor to Matlabtips.com. If you are interested in writing a guest post, please don’t hesitate to contact us

In this post, we talk about variables. In particular, we will explain where variables “sit” in memory depending on where you declared it (within a script or a function). This is a very important post if you are learning the language.

Continue reading

Posted in Beginners, Learning Matlab | Leave a comment

Happy new 2015

Happy new year coding in 2015 - Source : Image

Happy new year coding in 2015 – Source : Image

It is an established tradition that blogs will look back on new year and discuss past achievements. I also felt it was a good opportunity to share with you some results from this website statistics and suggest what the next year will be like.

Continue reading

Posted in Various | 1 Comment

Auto-contrast: an optimization example where Matlab beats Matlab

abstract-high-contrast-old-car-mike-loudemilk

An auto shown in high contrast – Source : Image

For this post, we are glad to have Thierry as a guest blogger. He talks about an optimisation example he recently encountered that is a good indirect example of ‘inlining‘.

As my first post here, I will first describe a standard “auto-contrast” method with some optimizing hints. I will then try a more powerful one, and hit a situation where the buit-in Matlab function (quantile) can be beaten by a simple Matlab script.

Continue reading

Posted in Optimizing your code | Tagged , , | Leave a comment

Debugging in Matlab

The first reported bug - Source : Wikipedia

The first reported bug – Source : Wikipedia

You’ve just finished writing your latest and greatest Matlab program. You’re sure this program will solve all the world’s (or at the very least all of your) problems. Just as you run your program, you see the dreaded red error text. Looks like it’s time to do some debugging! In this post, I’m going to take you through some of the common types of errors you will see when developing your software and how to solve those problems. Of course, when you’re first starting out in Matlab, these errors seem a bit cryptic and can take some time to solve. After just a bit of practice, though, you will soon be able to quickly spot and correct your errors.

Continue reading

Posted in Beginners | 2 Comments

Logical operations and logical indexing in Matlab

Nerd of all countries, standout! Source : Image

Nerd of all countries, stand up! Source : Image

In this post, we talk about logical operations but also how to use your Matlab skills to analyze your shopping expenses (Yes, we are all absolute nerds and love it).

You will learn how to use logical operations to search large data matrix very quickly. If you have never used logical operators in Matlab, this is a MUST-READ! Continue reading

Posted in Beginners | Leave a comment