- Questions »
- Computer Science »
- Software Engineering »
- Create your own 1. function in MATLAB to calculate...
32+ Users Viewed
10+ Downloaded Solutions
Tennessee, US Mostly Asked From
Create your own 1. function in MATLAB to calculate the probability density function (PDF) and cumulative distribution function (CDF) of a random variable that is one of the input arguments. Your function should output the location of each ‘bin’ and the respective PDF value, p(x). Use the first few lines below as a guide for your methodology. When you have created this function, test its output against the ‘hist’ or ‘histogram’ MATLAB routines (scaled properly) on sample data you have either collected or created. Include a plotting routine inside of your function file for the input data using the ‘bar’ and ‘plot’ commands. Inside of your function, • You should not reassign the input variables. Don’t have a line that says ‘x = randn(1000,1);’ for example. That should be done outside of the function, like so [bins, PDF] = pdf(randn(1000,1), 40); • Do not use the ‘hist’ or ‘histogram’ routines to compute the PDF or CDF. They should only be used to check your algorithm • You should rely on basic logic functions such as if, else, for, while, etc. Where applicable, you may use min(), max(), length(), size(), find(), and diff() among other basic functions built-in to MATLAB such as plot(), title(), xlabel(), and so on.
1 function [binsx, px] = pdf_plot(x, Nx) 2 % PDF - calculates a probability density function 3 % x = input data vector ** Do NOT overwrite! ** 4 % Nx = desired # bins for x ** Do NOT overwrite! ** 5 % px = probability density function 6 % binsx = centers of bin locations for px
Expert's Answer
Solution.pdf
Help us make our solutions better
Rate this solution on a scale of 1-5 star
X
Next Previous
Related Questions
Posted5 months ago
- Q: Write a script that starts by obtaining a vector x of N ¼ 1e6 normally distributed random numbers with the function randn. (a) Obtain the mean, variance and histogram of x. Use 51 bins for the histogram. Use the MATLAB built-in functions mean,... Posted 2 months ago
View Answer ►
- Q: Samples from a noise signal are given in the file data.mat. data.mat file :http://depositfiles.com/files/1lmxldg6z a) Plot the noise signal. b) Use MATLAB to find the PDF of noise. c) Plot the PDF of the noise samples d) Calculate and plot the CDF of... Posted 2 months ago
View Answer ►
- Q: Generate a set of 1000 i.i.d. uniform random numbers in the interval [-2, 2] by using the MATLAB function rand(1,N). Plot the histogram and the CDF using the generated sequence of numbers. Note: How to plot CDF using the generated sequence of... Posted 2 years ago
View Answer ►
- Q: 1. Use the Matlab “rand” function and a theoretically derived gain and offset to generate 1024 uniform random variables with mean 2 and variance 6. 2. Use the Matlab “randn” function and a theoretically derived gain and offset... Posted one year ago
- Q: Using the computer we can generate a large number of samples from a random variable. We will explore some of the concepts from random variables -- the probability mass (density) function, transformation of random variables, and conditional density --... Posted 2 years ago
Recent Questions in Software Engineering
- Q: Industrially advanced countries can help developing countries by Multiple Choice establishing price supports for the products produced by DVCs. increasing control over DVCs' ?capital markets. increasing tariffs and quotas on products produced by... Posted yesterday
- Q: Lauren is preparing a presentation for her class. She wants to make the slides and their objects appear and disappear to make it more interesting. What should she do? Group of answer choices A. Add SmartArt B. Use animations C. Apply a new theme D.... Posted yesterday
- Q: Simultaneously insert two blank rows above row 17. Create a line with markers chart using the range A5:F5. Use the Font dialog box to format the chart title with Bold and to change the title font color to Blue, under Standard Colors. Posted yesterday
- Q: 2.1.2: Concatenating strings. First, write two input() ?statements to read in values for my_city followed by my_state. Then, use string concatenation to assign log_entry with current_time, my_city, and my_state. Separate each value with a space... Posted yesterday
- Q: Search engine marketing aims to generate website traffic by Question 1 ?options: purchasing advertisem*nts on search engines. listing a company's website on as many search engines as possible. promoting the use of a search engine on a company... Posted yesterday
- Q: What does the SAP site offer to its users? Multiple Choice web-based training, code samples, computer systems, chat rooms, and blogs technical articles, web-based training, code samples, evaluation systems, discussion forums, and blogs technical... Posted yesterday
- Q: 1. While waiting for her latte at Starbucks, Georgia decides to check her work email and pay a few bills online. She opens the Wi-Fi settings on her device and sees several connections available. Knowing the activities she plans to do online, which... Posted yesterday
- Q: which two statements are true about Input Sets? an input set could contain another input set. an Input set must have at least one Entry Point. Input Set Ref widget could be used to reference a reusable Input Set from a Detail View. An Input Set must... Posted yesterday
- Q: Economics is best defined as the study of how: to eliminate the problem of scarce resources. to run a business. individuals can make money. individuals decide to use scarce resources in an attempt to satisfy their unlimited wants. the government... Posted yesterday
- Q: 15. Why would you refresh a materialized view in a PostgreSQL database before you use it? You need to refresh a materialized view so you can edit the data. The materialized view stores the data, so if you need to use the most current data you should... Posted yesterday
Submit your documents and get free Plagiarism reportPlagiarism Checker
more questions »
Ask A New Question
Copy and paste your question here...
Have a Referral code ?
Attach Files
Solve your Math Problem with one click