Skip to content

Instantly share code, notes, and snippets.

@yszheda
Last active August 9, 2017 02:41
Show Gist options
  • Save yszheda/62258c06c2637bab13675c22bdc1c993 to your computer and use it in GitHub Desktop.
Save yszheda/62258c06c2637bab13675c22bdc1c993 to your computer and use it in GitHub Desktop.
Display statistics of input rawdata and draw a plot figure of it.
% Display statistics of input rawdata
% and draw a plot figure of it.
infile = input('Please enter your data file:', 's');
rawdata = load(infile);
disp('90 percentile:');
disp(prctile(rawdata, 90));
disp('99 percentile:');
disp(prctile(rawdata, 99));
disp('statistics (minimum, first quartile, median, third quartile, maximum, mean, standard deviation, skewness, and kurtosis):');
disp(statistics(rawdata));
plot(rawdata)
fig_title = input('Please enter the title of the figure:', 's');
title(fig_title)
xlabel_name = input('Please enter xlabel (default is ''samples''):', 's');
if isempty(xlabel_name)
xlabel_name = 'samples';
end
xlabel(xlabel_name);
ylabel_name = input('Please enter ylabel (default is ''Time (ms)''):', 's');
if isempty(ylabel_name)
ylabel_name = 'Time (ms)';
end
ylabel(ylabel_name);
outfile = input('Please enter your figure filename:', 's');
print(outfile);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment