EX1010 - Introduction to MATLAB Assignment

Assignment Help MATLAB Programming
Reference no: EM132397083

EX1010 - Introduction to MATLAB Assignment - City University of London, UK

MATLAB Graphics Game Task -

You are required to submit two M-files that respond to the brief below. These files should be ready to be run in MATLAB to perform the tasks proposed in the brief.

You should not submit the numerical answers or the plots. Do not include any additional material apart from the two M-files because it will not be considered. However, you should include succinct comments within the M-files to explain the different parts and built-in functions that you are using, always respecting the rules for commenting in MATLAB. Only Moodle submissions will be considered. This work should be entirely your own. Any potential plagiarism (copying) will be investigated thoroughly. If plagiarism is found it will be treated a serious academic misconduct.

Problem - Consider a floor made of two parallel horizontal strips that are connected at y = 0. A straight needle of length L = 3 cm defined as a segment between the nodes A and B is dropped onto the floor and it stops at a random position given by the coordinates of its point A (xA, yA) and by its angle with respect to the horizontal line (θ), as shown in Figure 1.

1483_figure.png

You are asked to create a MATLAB M-file named "problem_XXX.m" (exactly like this, without capital letters or spaces, and substituting XXX by your full student number) that

1. Plots the needle at a random position on the floor considering that the point A of the needle can only be located in the square domain represented in Fig 1. This domain is a square of 20- cm centered at the origin of coordinates (x, y), as shown. The plot should be between -10 and 10 cm in the abscissas and in the ordinates. Use a solid black line to represent the needle and do not try to colour the background. Include a black horizontal line at y = 0. To represent the joint.

2. Uses a FOR loop to create a new plot with 50 needles distributed randomly on the floor. Use the same style and limits of the plot as in the previous section.

3. Counts how many of the 50 needles intersected (crossed) the joint of the floor in the previous plot and displays in the Command Window the proportion of the intersecting needles with respect to the total number of needles on the floor.

4. Creates a third plot that is the same as the second one but that represents the needles that intersect the joint in red colour and with a linewidth of 2 units, whilst the rest are plotted in black colour and with a linewidth of 1 unit. Use the same limits for the plot as in the previous sections.

Note: When running this file the three plots generated should appear in the screen. Hint: to avoid "losing" the first plot when the next one is generated you can use the command figure(). You are referred to the MATLAB Help for more information about how to use this command.

Note for curious minds: This is the Buffon's needle problem proposed by Georges-Louis Leclerc, Comte de Buffon, in the 18th century and it is the earliest problem in geometric probability that was solved. You can use your code to calculate the probability of a needle to lie across the line between the two strips of the floor (this is not part of the assessment). The solution of this probability is an approximation of the number π.

Reference no: EM132397083

Questions Cloud

Point-of-sale promotion on ballet flats : The shoe buyer ran a point-of-sale promotion on ballet flats for a Spring Sale weekend at 30% off. Here is what was sold during the sale:
Data originates from many sources : Data originates from many sources. Briefly summarize the types of data this activity may have generated.
Identify one core-competency : My group needs help with this question for our capsim report:
Short recap of problem you identified-cybercrime : A short recap of problem you identified -Cybercrime. Locate at least five scholarly peer-reviewed papers and at least three industry sources such as Websites.
EX1010 - Introduction to MATLAB Assignment : EX1010 - Introduction to MATLAB Assignment Help and Solution, City University of London, UK. MATLAB Graphics Game Task
Describe focus and the role that graduates are prepared for : Write 2 to 3 paragraphs, Comparing Psychiatric Nurse Practitioner and Family Nurse Practitioner, Identify each specialty and describe the focus and the role.
What are the pestel factors : 300 words on Identify and evaluate external influences that are positively and negatively affecting workforce needs in health care delivery.
Provide an example of toxic leadership in the workplace : Provide an example of toxic leadership in the workplace. Include a link to an article/video or describe the example for your peers.
Does having a competitive advantage mean : Does having a competitive advantage mean that a given company is better at creating economic value than its competitors? Explain why or why not.

Reviews

Write a Review

MATLAB Programming Questions & Answers

  Finite difference method

Use the finite difference method to calculate the temperature at the point specified since it is easier.

  Determine the necessary shell temperature

In a shell-and-tube heat exchanger, one fluid passes through a central tube while another fluid flows through an outer shell in the opposite direction. The purpose is to heat the fluid passing through the central tube.

  Find the integral of a function at an arbitrary location

Write a Matlab function to perform numerical integration of a set of evenly spaced data points using the trapezoidal rule

  Compute the speed of single-stage planetary gear train

Write a MATLAB function [speed] = planetary (N, emesh, first, last, arm) that computes the speed of a given link in a single-stage planetary gear train.

  Calculate and plot the error in the numerical derivative

Write a program to calculate and plot the error in the numerical estimate of the derivative.

  Create the graph using matlab functions

Create the graph, which contains a piecewise function where a line exists in the first interval, a parabola in the second interval, and the sine function in the third interval.

  Develop a simulation program

Develop a simulation program

  Create a vector in matlab

Create a three dimensional diagram of function.

  Open a named pipe and to read data from the pipe

Open a named pipe and to read data from the pipe in matlab

  Write the commands that will create the matrix

Write the commands that will create the matrix.

  Lagrange interpolating polynomial of degree

Lagrange interpolating polynomial of degree

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd