2 Make Plot Function Question 1 E 4 4 Q37203326

2. Make a plot of the function in Question 1 for E-4, 4]Using python

2. Make a plot of the function in Question 1 for E-4, 4] Show transcribed image text 2. Make a plot of the function in Question 1 for E-4, 4]


Answer


import matplotlib.pyplotas plt

import numpy as np

import math

# Ques 1 solution

# generate equally spaced 41 points between -4 and 4

x =np.linspace( 4, 4 , num = 41)

# Ques 2 solution

# list to store corresponding h(x) for x

h = []

# calculate the list y

for i inrange(0 ,len(x)):

    # calculate (x)

    h_x =math.exp(x[i]* x[i]/ 2

OR
OR

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.