matlab fun modified 3