How to combine these two sketches?

I'd like to combine two sketches together. Could someone help me?

LEDMatrixSerial.ino (9.44 KB)

SmartMatrix.ino (3.51 KB)

https://arduino-info.wikispaces.com/CombiningArduinoSketches

http://www.thebox.myzen.co.uk/Tutorial/Merging_Code.html

Could someone help me?

The most important thing for us to know is what the resulting program should do. Seems that you forgot to mention that.