我怎么能这样做?
public static double[] adjustFrequency(double[] samples, double factor) {
// samples = {1,2,3,4,5,6}
//adjustFrequency(samples, 0.5);
//samples = (1,1,2,2,3,3,4,4,5,5,6,6}
//adjustFrequency(sample, 0.5);
//samples = {1,3,5}
}
答案 0 :(得分:0)
您应该查看Java Array文档,尤其是函数copyOfRange()。这将允许您复制用于收缩或扩展的阵列的某些部分。