Monday, 25 May 2015

MATLAB: Array sort


Under certain circumstances, we might need to arrange values that we collect into a certain arrangement. This is known as sorting. Sorting not only identifies the important values but it also allows these values to be arranged according to priority.

Recognizing this importance, I'd like to discuss on a sorting algorithm which I came across while viewing the Introduction to Algorithms course by MITOpenCourseWare on iTunes and how I implemented it on MATLAB

Figure I. Pseudo code for insertion sort

Sunday, 17 May 2015

MATLAB: Using for loop to construct & arrange matrices


This blog post is to share one of my experiments using the For loop in MATLAB. My aim, initially, was to output a simple array from user input using the For loop. However, as the greed kicked in, I started craving for a more complex output.

Here's a quick snippet of what my code does.

Figure I. Automatically arranged matrix