Quicksort is accepted as the most efficient over a wide range of input array types (in terms of size and sorted-ness). It's algorithm is more complex, but still not difficult to implement on your own. Check out the link below. It shows animations of several common sorting algorithms and links to their pseudocode.
http://www.sorting-algorithms.com/
Or, if you just want to cheat, you can grab code from rosettacode:
http://rosettacode.org/wiki/Sorting_algo...
Most of those are implemented in MATLAB.