Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Help with Question part c , d and e please The muscular system is an important part of the human body, playing a major role
Help with Question part cd and e please
The muscular system is an important part of the human body, playing a major role in nearly all aspects of life. The body
controls muscle contraction using electrical signals from the nerves. Muscle activation is quantified using a measurement
technique called electromyography EMG for short and this data can be used to calculate multiple parameters about
the state of muscle activity.
The file EMGdata.txt contains measured EMG data from multiple muscles. The first column of the data contains the time
since the beginning of the measurement in seconds, with subsequent columns containing the measured electrical
activity of each muscle in millivolts mV
a Import the file EMGdata.txt and store all the electrical activity data as one matrix under one variable name.
b Create a by subplot in a figure. In the first subplot, plot all four channels against time on the same graph
using the MATLAB default graph colours and dots.
c Create a function named removenegativesthis should be in a separate m file that can be called from within
your lab script that cleans the provided data of negative numbers by removal and provides information about
the cleaning. The function documentation is provided below:
cleandata cleandata numnegative, numnonnegative removenegativesdata data
cleans the provided data of negative numbers by removal and provides
information about the cleaning
Author: Date:
input:
data vector of provided data to clean by removal of negative numbers
data vector of provided data that corresponds to dataie if data is the dependent
variable, data is the independent variable, and vice versa
output:
cleandata vector of data but with negative numbers removed
cleandata vector of data but with entries removed that correspond to negative values in
data
numnegative the number of negative numbers in dataie the number of removed elements
numnonnegative the number of nonnegative numbers in dataie the number of remaining
elements
Important: If you are struggling with a task, ensure that you have performed handwritten work eg hand
calculations, pseudocode, flow charts to better understand the processes involved. Do this before asking demonstrators
for help and use it to assist with your illustration of the problem.
d Due to errors in the calibration of the measurement equipment, the data recorded in EMGdata.txt is affected by
some error. As such, the EMG data in channel with negative values must be removed. Use the
removenegatives function on only channel to obtain the cleaned channel electrical activity and
corresponding time values, as well as the number of removed and remaining elements.
e In the second subplot, plot the cleaned channel data along with the other three channels against time using
the MATLAB default graph colours and dots. Use sprintf to display the number of removed values and the
number of remaining values in the subplots title ieCleaned EMG: removed XXX remaining
XXX where XXX is replaced by the respective values
Step 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