Helle everyone,
I have a dataset;
x = [100 10 1; 100 30 2 ; 100 40 1; 100 75 1 ; 101 10 2; 101 25 2 ; 101 50 1 ; 102 20 1; 102 25 2; 103 50 1]
the first column indicates order number,
the second column indicates cost,
the third column indicates firm. There are 2 firms and I want to find maximum value of order cost with respect to firms. If there is cost for that firm, I want to fill value as 0.
So, I want to find 2 different matrices.
for the firm 1;
firm1 = [100 75 1;101 50 1; 102 20 1; 103 50 1]
and firm2
firm2 = [100 30 2; 101 50 2; 102 20 2; 103 0 2]
note that for order number 103 cost value is 0 because there is no information for firm 2 about this order.
I want to use unique command with a loop but it fails.
Thank you so much in advance.
Regards,
0 Comments
Sign in to comment.