Skip to content

Give gauss function for the Gaussian Function challange #114

@Scottan

Description

@Scottan

in Chapter 3 numpy and matplotlib gaussian function challenge:

# Gaussian Function

1. Create a function called gauss which will take three arguments (inputs): x, µ, and σ, as defined above. Hint: you may wish to use the NumPy constant pi, and NumPy functions square, sqrt and exp for calcuating the square, square-root and exponential of e respectively for all elements in an array.
2. Create a NumPy array using the Numpy function linspace which will contain 1000 points equally spaced between x=-100 and x=100. Hint: You can print the help documentation of a function with ‘help(name_of_the_function)’.
3. Using the above gauss function and the array, create an array which contains the values of the Gaussian from x=-100 to x=100.
4. Use the ‘matplotlib’ library to plot the curve with µ=0 and σ=10.

give the answer to 1 first, because it is quite involved and time consuming, then students can focus on making the numpy arrays and plotting.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions