BUG: a typo error in matlab write function.