implement knapsack problem on matlab