Added indent
Formatted for readability
Ignored unused return values
Simplified some variable usage
Renamed 'struct' variable to 'config'

struct is a function name in Matlab
Documentation