clear
%a
for i=1:50
r=randn(10000,1);
x=cumsum(sign(r));
plot(x(1:5:end)),hold on
end
%b
xn=zeros(1,1000000);
xn_abs=xn;
for i=1:1000000
r=randn(10000,1);
x=cumsum(sign(r));
xn(i)=x(end);
xn_abs(i)=abs(x(end));
end
fprintf('average of x(10000): %f\n',mean(xn))
fprintf('average of |x(10000)|: %f\n',mean(xn_abs))
fprintf('Bn: %f\n',sqrt(2*10000/pi))
fprintf('an=0\n')
Please Solve this question by using Matlab. errors accumulate ran 1.1.6. It's reasonable to expect that...
We will be using Matlab as the software tool for this lab project. 1.Explore and become familiar with the random number generators in Matlab such as “rand”, “randn”, and “randi” (in fact all software tools can only generate pseudo-random numbers). Notice that to randomize the generators the use of “rng” function is encouraged as the previous techniques are discouraged. 2. “Random walk” is one of the primary and relative simple random processes in which the process starts from a neutral...
Implement the following problems in MATLAB and document your work using the report guidelines on the next page. 1. Use the subplot function to place the relevant graphical results in a single figure. Generate a sequence of 1000 pairs of independent zero-mean Gaussian random variables, where X has variance 2 and N has variance 1, Let Y = X + N be the equation for a noisy signal. Plot X, N, and Y in a 3D scatter plot using Y...
solve with only matlab, please. :) random 15.8 Ifr is a normal random number with mean 0 and variance 1 (as generated by randn), it can be transformed into a random number X with mean u and standard deviation a by the relation X=ar + In an experiment, a Geiger counter is used to count the radioactive emissions of cobalt 60 over a 10-second period. After a large number of such readings are taken, the count rate is estimated to...
need help with matLab Question 1 (20 Points) Write a well-documented MATLAB script hmwk7Q1.m that simulates tossing 100 coins into a unit square. As shown in the scatter plot. Location of Simulated Coins In Unit Square 1 o0 Ooo 05 04 03 02 oo 0.1 2 03 4 05 07 1 xpostion Hmwk7Q1.fig Consider organizing your MATLAB script into the following sections. % housekeeping (performs clearing of figures, workspace, and command lines) % Initialize the Number of Coins To Simulate...
solve using MatLab please. HW - 1 Use a cover page Word file attached for the homework solution. Solve all questions using Word and the Matlab output should be copied into the Word file. All questions and answers should be numbered HW1.1 Generate the following sequences using the basic MATLAB signal functions and the basic MATLAB signal operations discussed in this chapter. Plot signal samples using the stem function. 1- x(n) = n°[u(n+5] – u(n-6) + 105(n) + 20(0.5)* [u(n-4)...
matlab and comment please only need (D) In this exercise we learn how to solve constant-coefficient difference equation using Mat lab. Also, we investigate the response of systems to different kinds of inputs. (1) Consider the difference equation given as follows: y(n)= -0.9y(n 1)-0.81y(n 2)1.62x(n) +1.8r(n -1)+2x(n-2), n0 Find and plot r(n) and y(n) and hence find the energy of y(n) for the following cases: ( (d) a(n) r(n)r(n 25), where r(n) is the unit-ramp sequence. In this exercise we...
Please can you solve it using MATLAB. (1) Generate random signals [n] and hn, each of length N, and measure the time it takes to compute the linear convolution of r[n using the linear convolution definition and using the FFT method . Plot a graph of the results for N 104 to 10 in steps of 10. (2) Consider the signal x[n]-cos(0.3n),。£11S 100. Generate a plot of: ·The magnitude and phase of the DTFT of x[n] for 0 2π The...
USING MATLAB 7. A Fibonacci sequence is composed of elements created by adding the two previous elements. The simplest Fibonacci sequence starts with 1, 1 and proceeds as follows: 1,1,2,3,5,8,13, So, if f(1)-1 and f(2) -1, then f(3)-2)+f(1) We can represent this pattern as f(x) - f(x-1)+f(x-2). A Fibonacci sequence can be created with any two numbers. Prompt the user to enter the first two numbers in a Fibonacci sequence and the total number of elements requested in the sequence....
Can you help me with this question please? For the code, please do it on MATLAB. Thanks 7. Bonus [3+3+4pts] Before answering this question, read the Google page rank article on Pi- azza in the 'General Resources' section. The Google page rank algorithm has a lot to do with the eigenvector corresponding to the largest eigenvalue of a so-called stochastic matrix, which describes the links between websites.2 Stochastic matrices have non-negative entries and each column sums to1, and one can...
Solve using MATLAB (1) Consider the difference equation given follows as у(п) — — 0.9у(п - 1) — 0.81у(n — 2) + 1.62г(п) + 1.82(п — 1) + 2ar (п — 2), п > 0. Find and plot x(n) and y(n) and hence find the energy of y(n) for the following cases (а) 2(п) — 8(п — 2) (b) 2(п) — и(п) 6(п — 3) _ (с) г(п) — и(п)u(-п + 23) _ (d) x(n)r(n) - r(n - 25), where...