I have the following xy list:
list = {{19, 21991.4}, {63, 5801.71}, {71, 5714.21}, {99, 2021.72}, {135,
850.353}, {165, 1897.}, {220, 2117.53}, {251, 2444.39}, {274,
25136.6}}
I am just interested in the x positions, so I do the following:
x = First[list[[#]]] & /@ Range[Length[list]]
which gets me: {19, 63, 71, 99, 135, 165, 220, 251, 274}
Now I would like to create the following lists:
A list where there are zeros everywhere expect for the positions given at x, so something like this: 0,0,0,0,...1 (at position 19), 0,0,... 1 (at position 63)...
A list where I have 1,1,1,1, until position 19, then 2,2,2,2 until position 63 then 3,3,3,3 until position 71 etc.
How could I achieve that ?