How to solve this problem?

2 Ansichten (letzte 30 Tage)
Sherley Sherley
Sherley Sherley am 20 Sep. 2020
Kommentiert: Sindar am 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 Kommentare
Sherley Sherley
Sherley Sherley am 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
Sindar
Sindar am 21 Sep. 2020
check out subplot and plot

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Kategorien

Mehr zu 2-D and 3-D Plots finden Sie in Help Center und File Exchange

Tags

Produkte


Version

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by