Question
The variance is a way of determining the spread of data. The equation for the variance is: variance = 1-Write a function called variance1 that
The variance is a way of determining the spread of data. The equation for the variance is:
variance =
1-Write a function called variance1 that calculates the variance for a vector passed to the function. This function should USE FOR LOOPS, NOT VECTORIZED CODE.
2-Write a function called variance2 that calculates the variance for a vector passed to the function, but that USES ONLY VECTORIZED CODE, NOT FOR LOOPS.
3-Write a script that will:
a-Load the file physiodata.mat that you used for programming example 3.
b-LOOP (until the user closes the menu without responding), presenting a menu to the user asking which measurement they are interested in: weight, diastolic pressure, systolic pressure, or heart rate. When the user closes the menu without responding, the program should end.
c-Depending on which measurement they choose send the corresponding vector to a function called cleandata, which should remove all values less than 10, and return a cleaned vector to the main function.
d-Pass the cleaned vector to the function you created called variance1 and display the result
e-Pass the cleaned vector to the function you created called variance2 and display the result
f-Pass the cleaned vector to the matlab function var (use help to figure out how to use it) and display the result
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