How to solve this problem?

1 visualización (últimos 30 días)
Sherley Sherley
Sherley Sherley el 20 de Sept. de 2020
Comentada: Sindar el 21 de Sept. de 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 comentarios
Sherley Sherley
Sherley Sherley el 20 de Sept. de 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 el 21 de Sept. de 2020
check out subplot and plot

Iniciar sesión para comentar.

Respuestas (0)

Categorías

Más información sobre 2-D and 3-D Plots en Help Center y File Exchange.

Etiquetas

Productos


Versión

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by