(Get Answer) - Create your own 1. function in MATLAB to calculate the probability...| Transtutors (2024)

  1. Questions
  2. »
  3. Computer Science
  4. »
  5. Software Engineering
  6. »
  7. Create your own 1. function in MATLAB to calculate...

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

(Get Answer) - Create your own 1. function in MATLAB to calculate the probability...| Transtutors (4)

Next Previous

Related Questions

Q: Confirm that the MATLAB function randn() or normrnd() produces a Gaussian Random Variable by... To confirm that the MATLAB function randn() or normrnd() produces a Gaussian Random Variable, you can follow these steps. I'll provide a MATLAB code snippet to help you achieve this: matlab % Generate 20,000 random numbers with mean 0 and standard deviation 1 randomNumbers = randn(1, 20000); % Plot the histogram...

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

Plagiarism Checker

Submit your documents and get free Plagiarism report

Free Plagiarism 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

    (Get Answer) - Create your own 1. function in MATLAB to calculate the probability...| Transtutors (6)


    (Get Answer) - Create your own 1. function in MATLAB to calculate the probability...| Transtutors (2024)
    Top Articles
    Latest Posts
    Article information

    Author: Arielle Torp

    Last Updated:

    Views: 5887

    Rating: 4 / 5 (41 voted)

    Reviews: 88% of readers found this page helpful

    Author information

    Name: Arielle Torp

    Birthday: 1997-09-20

    Address: 87313 Erdman Vista, North Dustinborough, WA 37563

    Phone: +97216742823598

    Job: Central Technology Officer

    Hobby: Taekwondo, Macrame, Foreign language learning, Kite flying, Cooking, Skiing, Computer programming

    Introduction: My name is Arielle Torp, I am a comfortable, kind, zealous, lovely, jolly, colorful, adventurous person who loves writing and wants to share my knowledge and understanding with you.