How to solve this problem?

1 view (last 30 days)
Sherley Sherley
Sherley Sherley on 20 Sep 2020
Commented: Sindar on 21 Sep 2020
Problem 1. Provide the option to load a data file. You will then need to create a time vector corresponding to the number of data points based on the sample rate.
Problem 2. Allow the user to change the data frequency.
Problem 3. Plot the data using subplots, allowing the user to select the number of rows and columns for the subplot. Use a function to generate the subplots. Be as generic as possible.
Problem 4. Plot the data with statistics. Allow the user to select the statistic first (mean, max, standard dev). Put all of this in one or more functions.
General information: Use functions! Put them at the end of the code after the main script. Try to be as generic as possible and minimize hard-coding.
  3 Comments
Sherley Sherley
Sherley Sherley on 20 Sep 2020
I made this but I did not know how to do problem 2-4.
% Create a loop for menu
keep_looping = true;
while (keep_looping == true)
% Create a menu
choice = menu ('Select option: ', 'Load data file', 'Specify data frequency, Hz', 'Plot raw signals', 'Plot signals with statistics', 'Exit');
% Problem 1:
if (choice == 1)
% Load data file
load('EMGHW4.mat');
uiwait(msgbox('Data loaded'))
timeVec = ((0:(length(EMG)-1))/sampleRate);
% Problem 2:
elseif (choice == 2)
% Change data frequency
uiwait(msgbox('Data frequency, Hz')
% Problem 3:
elseif (choice == 3)
% Problem 4:
elseif (choice == 4)
else
msgbox('Exit')
keep_looping = false;
end % end if statement
end % end while looping

Sign in to comment.

Answers (0)

Categories

Find more on 2-D and 3-D Plots in Help Center and File Exchange

Tags

Products


Release

R2020b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!