Info

此问题已关闭。 请重新打开它进行编辑或回答。

Help with if condition

1 次查看(过去 30 天)
Carlos Alvarez-Santullano
关闭: Stephen23 2017-5-6
he thing is i have a matrix where the first column is the code of the item sold and the second column is the week where that item were sold. Im trying to know the frecuency of sales of each item im working with (meaning this if the item has been sold every week or just in a few weeks).
This is my matrix
Item week
0012 1
0013 1
0012 2
0012 2
0012 2
0013 2
0013 3
n 53
So i want to know how to make a code that give me as a result this
Item week1 week2 week3 week4 week5
0012 1 1 0 0 1
0013 0 0 1 0 0
n 1 0 1 1 0
Meaning this the item 0012 were sold on week1 week2 week5 no sales for week3 and week4.
And it would be so much better if possible if the code result is this:
Item week1 week2 week3 week4 week5
0012 1 2 0 0 3
0013 0 0 1 2 0
n 1 0 3 2 0
Meaning this the item 0012 were sold once on week1 twice on week2 and 3 times on week 5.

回答(0 个)

此问题已关闭。

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by