Utilize advanced plotting utilities to create high quality figures
Design plots to convey data meaningfully
A working copy of single *.m file for cach part, well-commented, with your name, date, and assignment
description at the top.
Your second lab assignment introduced you to advanced plotting features of MATLAB. In this homework
assignment you will write MATLAB code to generate a small handful of nicc-looking figures. Be sure to
reference back to previous assignments, MATLAB help files, and the Zybooks text if you get stuck.
Task 1: In the lab assignment, you created a smooth ECG recording by averaging together five separate recordings
Create an *.m fike, and load both your smoothed ECG and one of the original ECG recording files provided in the
sccond lab. Create a now figure and plot both an original ECG recording and your smoothed ECG recording, Use
different colors for cach signal. Include legend indicating which color corresponds to which recording, Be sure to
create time vector so that your x-axis values are in scconds Include axis labels and plot title.
Task 2: Instead of placing the two recordings on the same plot, as in Task 1, produce two plots side-by-side. One will
have the original unsmoothed recording and the other the smoothed ECG waveform. (This is just repcat of Task but
on two separate plots). All the usual components should be included on both plots
Task 3: Each of the ECG recordings you have used so far contains only one ECG cyck. In typical electrocardiogram,
a similar signal morphology would repcat so long as the individual's heart is beating. Using your knowledge of
MATLAB, create a new ECG recording by repeating your smoothed ECG recording three times into one ECG
recording (sce below). Plot and label your signal appropriately Bc sure that your x-axis now accounts for signal that is
three times as long as the original.
You are given the following sct of data obtained experimentally
(x) measured in
Create a MATLAB script to perform the following tasks:
1. Sclect appropriate type of plot to present this data (chose from lin-lin, log-lin, lin-log and kog-log). Explain why you
chose this type using comment line(s) in your code.
2. Plot the data points on your selected type of graph.
3. On the same graph, plot the best fit line through the data points.
You can either calculate the line's parameters manually using the linear regression cquations, or you can
use MATLAB's built-in pablif function.
Use different colors for the measured data points and the fitted line. Properly label the axes, provide good title,
and add legend.
You are given the following function to plot:
where CO 2nd and fis signal frequency in Hz (Hertz), R is resistance in o (Ohms) and Cis capacitance in P (Farads).
Variable H on the left is your dependent variable and frequency f is your independent variable. Create a MATLAB script
to perform the following tasks:
Choose reasonable number of data points over a frequency range from 0.1 Hz to 100kHz. (hint: consider
whether linspace or logspace function would be useful for this problem)
Plot H versus f for these combinations of R and C:
R C 200 up
b. R 10k9, C 0.05 pF
Place both curves on the same log-log graph.
Use different colors and line styles for the curves. Properly label the axes, provide : good title, and add a
This material may consist of step-by-step explanations on how to solve a problem or examples of proper writing, including the use of citations, references, bibliographies, and formatting. This material is made available for the sole purpose of studying and learning - misuse is strictly forbidden.
% Clearing memory, screen and closing all open plots
% Loading ECG data
% Creating an average ECG out of five seperate recordings
% Creating a time vector