zl程序教程

您现在的位置是:首页 >  后端

当前栏目

Java建立计算高斯函数的计算机方法

JAVA方法计算计算机 函数 建立 高斯
2023-09-14 09:14:08 时间

建立计算高斯函数的计算机方法

public class Test17 {
    public static void main(String[] args) {
        double y;
        Scanner input = new Scanner(System.in);
        System.out.println("请确定a(a>0)的实数常数:");
        double a = input.nextDouble();
        System.out.println("请确定b的实数常数:");
        double b = input.nextDouble();
        System.out.println("请确定c的实数常数:");
        double c = input.nextDouble();

        for (double x = -5.0; x < 6.0; x++) {
            double i = Math.pow(Math.E, (-(x - b) * (x - b)) / (2 * c * c));
            y = a * i;
            System.out.println("y = " + y);
        }
    }
}

高斯函数(Gaussian function)的详细分析:详细讲解看链接高斯函数(Gaussian function)的详细分析_qinglongzhan的博客-CSDN博客_高斯函数