Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask MATLAB Expert

ASSIGNMENT

1) You can ask questions in the Discussion Board on Moodle

2) Hints and additional instructions are provided as comments in the assignment template M-Files

3) Hints may also be provided during lectures

4) The questions have been split into sub-questions. It is important to understand how each sub- question contributes to the whole, but each sub-question is effectively a stand-alone task that does part of the problem. Each can be tackled individually.

5) I recommend you break down each sub-question into smaller parts too, and figure out what needs to be done step-by-step. Then you can begin to put things together again to complete the whole.

6) To make it clear what must be provided as part of the solution, I have used bold italics and a statement that (usually) starts with a verb (e.g. Write a function ..., Print the value..., etc.)

QUESTION 1

Q1a. Following the above example, we transmit a set of modulated data from the base station to mobile handset, and the data file is saved to the file transmission_data.txt with an unknown number of lines. In this data file, there are some empty lines and some text lines.

Write a MATLAB script that will read all data from this file and skip the empty lines and text lines and store the data in a matrix called ‘signal'.

Output the size of the matrix ‘signal' to the command window.

Then using the command ‘fprintf', print out the entire matrix ‘signal' (each element in the matrix can be printed out using conversion specifier ‘%4d'). The print-out should be in the same format as the matrix ‘signal' (i.e., same row number, same column number, same values).

Q1b: At the receiver, we measure the error rates and store them in a file called ‘errorrate.txt'. These error rates are measured at different signal power-to-noise ratios in decibels (dB), which are stored in another file called ‘SNR.txt'.

Load both files into MATLAB and use the plot command ‘semilogy' to plot the error rate (y-axis) versus signal-to-noise ratio (x-axis). In this figure, use red circle data marker and a red solid line. Ensure the plot has a title called ‘Error rate curve'. Also add a background grid to the plot.

Q1c: Assuming the system conducts 10 transmissions; we measure the power level in dB for each transmission and write them to a file called ‘power.txt'.

- Load these data and compute the average power.

- Print out the average power using fprintf with a width of 10 characters and precision 2.

- Find the maximum power and use fprintf and conversion specifier ‘%d' to print out the result and start a new line after the print out.

- Find how many transmission powers are above this average and use fprintf and conversion specifier ‘%d' to print out the result, and start a new line after the print out.

Question 2

Q2a. Read in the pressure drop data from "Pressure_Drop.txt". You will need to skip over the header information.

(IMPORTANT NOTE: You MUST ensure that all units in your data are consistent, i.e. S.I. units - you cannot mix units.)

Create a figure with two sub-plots (one above the other). In the top sub-plot, plot dP vs V as a linear-linear plot, and in the lower sub-plot plot the same information in log-log coordinates (using the MATLAB plot command loglog). Ensure the appropriate units are included in the axis labels. Plot each data point as a red dot (do NOT join these symbols with a line). In both subplots, select ONLY those points with Φ = 0.05 and δ = 0.5) and plot these on the same plots as blue circles (there should be a red dot inside each one).

In the log-log plot, it will be obvious that the data appears to have a particular type of behaviour. Print a brief statement to the command window that describes this behaviour (no more than 3 lines of text).

Q2b. Write a function called PowerFit that does a non-linear curve fit to data of the form y=Axn. Input parameters are x and y, output parameters are A and n. Inside PowerFit, you can write your own code or use in-built MATLAB functions as you wish.

Q2c. As mentioned, the data has been measured at 4 different porosities (Φ = 0.05, 0.1, 0.2, 0.5) and 7 different thickness ratios (δ = 0.05, 0.1, 0.25, 0.5, 1.0, 2.0, 3.0) and a wide range of velocities. Unfortunately the data has been entered into the file in a random order. In order to estimate the exponent (n) in Eqn 1, you can ONLY consider data for one value of Φ and one value of δ at a time.

Calculate the curve of best fit using your function PowerFit for each pair of (Φ,δ) values separately (there are 4x7=28 different combinations).

Estimate the MEAN value of the exponent in the power law fit, (n) by averaging the values estimated for each (Φ,δ) pair. NOTE: if there are less than 5 data points for a given combination of (Φ,δ), then do not include the exponent estimate in the average as the data is not reliable for too few measurements.

Print the average value of the exponent to the command window (to 2 decimal places) AND print the number of different (Φ,δ) pairs that contributed to the average.

Q2d. Once you have found n, the next thing to do is to determine an appropriate function for f(δ). You can use ALL of the data in the file. For each line of data, calculate K(Φ) using Eqn 2 and Vn using the results of Q2c. Then calculate the value of f using Eqn 1 for each line of data in the file.

Perform a least squares polynomial fit to all of the (δ, f) values using polyfit with a third order polynomial - your output will be a set of coefficients that describe a polynomial p(δ) that is a lest squares approximation for f(δ).

Plot the values of f that you calculated with blue dots and the best fit polynomial p(δ) with a red line in the top subplot of a (new) figure. You will see that the curve fit is not that good.

Calculate the coefficient of determination and add it to the top subplot as a text label using the MATLAB command ‘text'.

Someone suggests that the data could be well-fitted with a function that is given by some polynomial p(δ) DIVIDED by δ (i.e. f(δ) ≈ p(δ)/δ ).

Using a suitable transformation of the data2, perform this alternative least squares fit (using a third order polynomial and polyfit).

In the lower subplot of the same figure, plot f with blue dots and the new best fit function (p(δ)/δ ) with a red line.

Calculate the coefficient of determination and add it to the lower subplot.

Print a brief statement to the command window as to which method is best and provide a possible reason for this.

Q2e. The shape of the best fit function in Q2d suggests that there is a minimum value of f(δ) somewhere in the range δ ∈[0.5, 3]. You are required to use the concepts discussed in Lecture 14 (associated with Optimization) to find this minimum.

Using the best fit function from the second part of Q2d (i.e. p(δ)/δ ) and a root finding technique, find this minimum value and the value of δ at which it occurs. You can use any root finding technique you like including MATLAB's fzero. To use root finding, you will also need to write a function that returns the derivative of (p(δ)/δ ). If you want, you can use the MATLAB function "min" to check your answer to this part of the question, but you cannot provide this as your solution.

Print the minimum f(δ) and the value of δ at which it occurs to the command window. Add a solid green circle to the second subplot in Q2d that represents this minimum point.

Write a brief comment to the command window that describes what this minimum point represents physically.

You have to complete all the questions in the templates given in the zip file

Attachment:- Templates.rar

MATLAB, Engineering

  • Category:- MATLAB
  • Reference No.:- M91768885
  • Price:- $150

Guranteed 48 Hours Delivery, In Price:- $150

Have any Question?


Related Questions in MATLAB

Question - verify the attached paper with matlab and get

Question - Verify the attached paper with matlab and get all the results in the paper and explain step by step the matlab code. Paper - Improving Massive MIMO Belief Propagation Detector with Deep Neural Network. Attachm ...

Assignment -we have daily gridded rainfall data of 40 years

Assignment - We have daily gridded rainfall data of 40 years and structure of the dataset is like below; Lat = [6.5:0.25:38.5]; Lon = [66.5:0.25:100]; Rainfall (135x129x365x40) (Lon, Lat, days, years). Now, we looking fo ...

Discrete optimisation- solve the following two problems

Discrete Optimisation - Solve the following two problems with both exhaustive enumeration and branch and bound - Problem 1 is a mixed integer linear optimisation problem (the problem has both discrete and continuous vari ...

Question 1 manipulate spectral imagehyperspectral images

Question 1. Manipulate spectral image Hyperspectral images can be seen as a generalisation of normal colour images such as RGB images. In a normal RGB colour image, there are 3 channels, i.e. channels for red colour, gre ...

Assignment -matlab codes and simulated model in

Assignment - Matlab codes and simulated model in simulink/matlab and truetime. 1. Matlab codes and simulink model for pid controller optimization using particle swarm optimization (PSO) my plant is integer order 1000/(s^ ...

Question a safe prime is a prime number that can be written

Question : A safe prime is a prime number that can be written in the form 2p + 1 where p is also a prime number. Write a MATLAB script file that finds and displays all safe primes between 1 and 1000.

What comparison of means test was used to answer the

What comparison of means test was used to answer the question

Assignmentafter the success of your robo-advice venture you

Assignment After the success of your robo-advice venture you decide to explore alternative sources of profitability for your company. You realize that Australian investors are often forced to chose between expensive acti ...

Suppose that you have used some concept learning algorithm

Suppose that you have used some concept learning algorithm to learn a hypothesis h1 from some training data. You are interested in knowing the accuracy that the hypothesis can be expected to achieve on the underlying pop ...

Prepare a 3 - 10 pages long reportprepare a presentation

Prepare a 3 - 10 pages long report Prepare a presentation with 5 - 9 slides. The slides will include introduction (need and similar work), theoretical background (tested neural networks), Data, Results (Comparison of the ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As