Goal Seek algorithm in matlab