How to solve this problem?

1 次查看(过去 30 天)
Sherley Sherley
Sherley Sherley 2020-9-20
评论: Sindar 2020-9-21
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 个评论
Sherley Sherley
Sherley Sherley 2020-9-20
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

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 2-D and 3-D Plots 的更多信息

标签

产品


版本

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by