QT中写一个求QVector容器中数据均值的函数
double MainWindow:: get_mean(QVector<double> in){double sum = std::accumulate(in.begin(), in.end(), 0.0);double mean =sum / in.size(); //均值return mean;}
·
double MainWindow:: get_mean(QVector<double> in)
{
double sum = std::accumulate(in.begin(), in.end(), 0.0);
double mean = sum / in.size(); //均值
return mean;
}
更多推荐
已为社区贡献1条内容
所有评论(0)