Question

Given the function y = e-0.4(x-3)^2. Compute the corresponding values of yh. Use the bar(xh,yh,.3) command...

Given the function y = e-0.4(x-3)^2. Compute the corresponding values of yh. Use the bar(xh,yh,.3) command to produce a bar graph. Next superimpose a continuous bell curve over it by taking one thousand samples of a new variable x again from 0 to 6 with the step size 6/999. Issue the hold on command and then use plot(x,y,’r’,’LineWidth’,2) command. All these commands are listed below.

clear all; close all ; clc xh = 0:6/9:6;
yh = exp(-0.4*(xh-3).^2); bar(xh,yh,0.3);

hold on
x = 0:6/999:6;
y = exp(-0.4*(x-3).^2); plot(x,y,’r’,’LineWidth’,2) xlabel(’x’);
ylabel(’y’);
axis tight

Use MATLAB to answer and post the code in your response.

Homework Answers

Answer #1

code :

output :

raw_code :

clear all; %clear workspace
close all;
clc

xh = 0:6/9:6; %creating xh in [0,6] with 6/9 step
yh = exp(-0.4*(xh-3).^2);
bar(xh,yh,0.3); %to produce bar graph

hold on %to plot on same figure
x = 0:6/999:6;
y = exp(-0.4*(x-3).^2);
plot(x,y,'r','LineWidth',2) %plotting bell curve in red
xlabel('x');
ylabel('y');

axis tight

***do comment for queries and rate me up***

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
Write a MATLAB m file to plot the 3-D curve represented by a multivariable function z(x,y)...
Write a MATLAB m file to plot the 3-D curve represented by a multivariable function z(x,y) = x2 −0.5y2 over x ∈ [−2,2] and y ∈ [−2,2]. Use a 2 point thickness. For both x an y axes, choose the grid size to be 0.05. Clearly label and title your plot. Rotate the view at an azymuth of −20 , and elevation of 20 . You need to use the following commands: x=-2:0.05:2; y=x; z=x.^2-0.5*y.^2; plot3(x,y,z,’LineWidth’,2) label(’ My 3D curve’);...
Assignments Generate and plot the signal x1(t) = 1+ sin (4pt), for t ranging from -1...
Assignments Generate and plot the signal x1(t) = 1+ sin (4pt), for t ranging from -1 to 1 in 0.001 increments. Use proper axes labels with title. Generate and plot the function x2(t) = sin (30pt), for t ranging from -1 to 1 in 0.001 increments. Use proper axes labels with title. Generate and plot the combination function x3(t) = x1(t)*x2(t) as above. Use proper axes labels with title. Generate and plot the sum of two cosine waves   v1(t) =...
SIGNALS AND SYSTEMS Experiment 1    Signal Generation Date: January 1-8, 2018 The purpose of this...
SIGNALS AND SYSTEMS Experiment 1    Signal Generation Date: January 1-8, 2018 The purpose of this laboratory is to familiarize you with the basic commands in MATLAB for signal generation and verify the generated signal. Objectives 1.Learn basic MATLAB commands and syntax, including help system. 2.Use MATLAB ( from Citrix) to generate and plot different signals. Assignments Generate and plot the signal x1(t) = 1+ sin (4pt), for t ranging from -1 to 1 in 0.001 increments. Use proper axes...
A table of values is given for a function f(x, y) defined on R = [1,...
A table of values is given for a function f(x, y) defined on R = [1, 3] × [0, 4]. 0 1 2 3 4 1.0 2 0 -3 -6 -5 1.5 3 1 -4 -5 -6 2.0 4 3 0 -5 -8 2.5 5 4 3 -1 -4 3.0 7 8 6 3 0 Estimate f(x, y) dA R using the Midpoint Rule with m = n = 2 and estimate the double integral with m = n =...
Using MATLAB Write a user-defined MATLAB function for the following math function: y(x)= (-0.2x^3 + 7x^2)e^-0.3x...
Using MATLAB Write a user-defined MATLAB function for the following math function: y(x)= (-0.2x^3 + 7x^2)e^-0.3x The input to the function is x and the output is y. Write the function such that x can be a vector (use element-by-element operations). (a) Use the function to calculate y(-1.5) and y(5). (b) Use the function to make a plot of the function y(x) for -2 ≤ x ≤ 6.
Suppose the joint probability distribution of X and Y is given by the following table. Y=>3...
Suppose the joint probability distribution of X and Y is given by the following table. Y=>3 6 9 X 1 0.2 0.2 0 2 0.2 0 0.2 3 0 0.1 0.1 The table entries represent the probabilities. Hence the outcome [X=1,Y=6] has probability 0.2. a) Compute E(X), E(X2), E(Y), and E(XY). (For all answers show your work.) b) Compute E[Y | X = 1], E[Y | X = 2], and E[Y | X = 3]. c) In this case, E[Y...
Consider the vector field F = ( 2 x e y − 3 ) i +...
Consider the vector field F = ( 2 x e y − 3 ) i + ( x 2 e y + 2 y ) j , (a) Find all potential functions f such that F = ∇ f . (b) Use (a) to evaluate ∫ C F ⋅ d r , where C is the curve r ( t ) = 〈 t , t 2 〉 , 1 ≤ t ≤ 2 .
Problem 3 you can use Matlab and also i give u the Problem 1 code its...
Problem 3 you can use Matlab and also i give u the Problem 1 code its on Matlab Using the same initial code fragment as in Problem 1, add code that calculates and plays y (n)=h(n)?x (n) where h(n) is the impulse response of an IIR bandpass filter with band edge frequencies 750 Hz and 850 Hz and based on a 4th order Butterworth prototype. Name your program p3.sce this is the Problem 1 code and the solutin clear; clc;...
Calculate the Y values corresponding to the X values given below. Find the critical values for...
Calculate the Y values corresponding to the X values given below. Find the critical values for X for the given polynomial by finding the X values among those given where the first derivative, dy/dx = 0 and/or X values where the second derivative, d­2y/dx2 = 0. Be sure to indicate the sign (+ or -) of dy/dx and of d2y/dx2 tabled values. Reference Power Point Lesson 13 as needed. Using the first and second derivative tests with the information you...
Calculate the Y values corresponding to the X values given below. Find the critical values for...
Calculate the Y values corresponding to the X values given below. Find the critical values for X for the given polynomial by finding the X values among those given where the first derivative, dy/dx = 0 and/or X values where the second derivative, d­2y/dx2 = 0.    Be sure to find the sign (+ or -) of dy/dx and of d2y/dx2 at all X values. Reference Lesson 13 and the text Appendix A (pp 694 – 698), as needed. Using the...
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT