Question
1) Write a function called generate_random_vector that will generate an array of random values that are from a uniform distribution (hint: inside it should use
1) Write a function called generate_random_vector that will generate an array of random values that are from a uniform distribution (hint: inside it should use the Matlab-provided rand function). It should take as inputs a scale that will scale the output and a count that will indicate how many samples to generate. The output should be a column vector of the appropriate length and magnitude.
2) Write a function called generate_random_vector_corrupted that is identical in every way to (1), except that every third element of the returned vector is zero. In your code, show how to do this both using a for loop and using Matlab vector indexing.
Write a function called generate_random vector that will generate an array of random values that are from a uniform distribution (hint: inside it should use the Matlab-provided rand function). It should take as inputs a scale that will scale the output and a count that will indicate how many samples to generate. The output should be a column vector of the appropriate length and magnitude. Write a function called generate_random vector_corrupted that is identical in every way to (1), except that every third element of the returned vector is zero. In your code, show how to do this both using a for loop and using Matlab vector indexingStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started