What percentage of the values in the matrix are prime number


Matlab Assignment

1. (1) In one figure window and without using subplot plot

y=mx+b

with m = 2, b = -1, 0, 1 from c = 0.01 ? 100 using:

a) plot(x, y); grid
b) semilogx(x, y); grid
c) semilogy(x, y); grid
d) loglog(x, y); grid

So four plots, each with three curves. Comment on the results

(2) What functions produce straight lines when plotted using semilogx and semilogy? Show example plots

2. Write a script that makes a line plot of sinc function

y(x)=sinc?(px)=sin?(px)/px

from x = -10 to 10. Use eps to address the singularity that occurs at x = 0. Use handle graphs make the figure fill a 5 inch wide by 2 inch tall. The curve should be a thick purple line.

3. Make a polar plot of the following function:

y(x)=sin?(2x)

Use handle graphs make the figure fill a 5 inch by 5 inch square. The curve should be a thick green dash line.

4. Use the MATLAB® audio command to create a sound file (.wav) using 22,000 random numbers and a sampling frequency of 44 kHz. What is the duration of this sound clip?

5. Import and plot federal_funds_rate.xlsx since 1955. Also save a plot in either .png or .jpeg format.

6. Use a single fimplicit function to plot the following hyperbolars in one plot.

y^2-x^2=c for c = -4, -2, 0, 2, 4

7. The command spiral(3) generates the following number spiral matrix

S3 = (7 8 9
6 1 2
5 4 3)

where it starts with the number 1 at the center of the matrix and counts up by spiraling around the center.

(a) Write a program that makes a 2-D plot binary that differentiates the prime numbers from the non-prime numbers in this matrix for a relatively large spiral matrix, say n > 250.

(b) What percentage of the values in the matrix are prime numbers?

(c) In the same plot window, make a second plot of a 2-D matrix of randomly distributed ones and zeros that has the same percentage of ones as the first matrix.

(d) Comment on the differences you see in these plots

Format your assignment according to the following formatting requirements:

1. The answer should be typed, double spaced, using Times New Roman font (size 12), with one-inch margins on all sides.

2. The response also includes a cover page containing the title of the assignment, the student's name, the course title, and the date. The cover page is not included in the required page length.

3. Also include a reference page. The Citations and references should follow APA format. The reference page is not included in the required page length.

Request for Solution File

Ask an Expert for Answer!!
MATLAB Programming: What percentage of the values in the matrix are prime number
Reference No:- TGS03014923

Expected delivery within 24 Hours