请教:有数据x1,x2,x3,分别计算其p10,p50,p95,然后建立新数据c_x1-c_x3,其中if x1>p95 then c_x1=1,else if x1>p50 then c_x1=2,else if x1>p10 then c_x1=3;else c_x1=0;c_x2 c_x3也类似得出,怎样写出比较简洁的程序?
x1 x2 x3
1.5 6.7 11.2
0.5 5.4 12.5
1.1 5.7 15.4
1.8 8.4 10.8
2.5 7.5 12.3
2.1 6.2 14.4
3.0 7.8 11.9
0.8 5.6 13.7
0.1 8.1 14.1
2.8 5.9 11.3