Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/fortran/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/perl/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在Fortran中查找十分位/四分位的最佳方法?_Fortran - Fatal编程技术网

在Fortran中查找十分位/四分位的最佳方法?

在Fortran中查找十分位/四分位的最佳方法?,fortran,Fortran,我想知道一种在fortran代码中查找十进制/桶/组的有效方法 如果我有一个数组(1:totaldatacount),其中包含权重(LB)数据,如 120 140 200 134 185 . . . 我希望得到3组30%和70%的断点 我所做的是对数组进行排序,然后根据数据总数分配断点 第一个断点:总数据计数*0.3// 第二个断点:总数据计数*0.7 因此,第一组(1-30)获得数组(1:totaldata*0.3) 第二组(31-70)获取数组(totaldata*0.3+1:totald

我想知道一种在fortran代码中查找十进制/桶/组的有效方法

如果我有一个数组(1:totaldatacount),其中包含权重(LB)数据,如

120
140
200
134
185
.
.
.
我希望得到3组30%和70%的断点

我所做的是对数组进行排序,然后根据数据总数分配断点

第一个断点:总数据计数*0.3// 第二个断点:总数据计数*0.7

因此,第一组(1-30)获得数组(1:totaldata*0.3)

第二组(31-70)获取数组(totaldata*0.3+1:totaldata*0.7)

第三组(71-100)获取数组(totaldata*0.7+1:totaldata)


这有意义吗?有人有创建3个存储桶(已排序)的代码吗?

您所描述的似乎很简单,而且(如果您选择的排序例程很好的话)效率很高(足够)。所以,是的,这是有道理的。您已经有了自己的代码。那么你的问题还剩下什么?我想知道是否有任何预构建的函数用于此。。。如果没有,那么我想我会使用上面描述的方法,因为肯定没有Fortran内在例程来解决您的问题,而且我发现还没有人提出您所寻求的代码。