Effacer les filtres
Effacer les filtres

Saving figure data statistics without using the GUI?

1 vue (au cours des 30 derniers jours)
Rose Lakatos
Rose Lakatos le 20 Juil 2018
Can I save all the xstats and ystats of a specific figure without doing it manually? I can currently do it by opening each figure, going to tools, data statistics and save to workspace on data1, data2,... There must be a better way than doing it manually.

Réponse acceptée

Ryan Takatsuka
Ryan Takatsuka le 20 Juil 2018
You can create a function to collect this data for you. To create a structure with the same format as Tools -> Data Statistics from the figure menu, the following function can be used:
function data_stats = getDataStats(data)
% This function gets the data statistics that can be found in the figure menu:
% Tools -> Data Statistics
%
% SYNTAX
% stats = getDataStats(data)
%
% INPUTS
% data: a vector containing the data to get statistics for
%
% OUTPUTS
% data_stats: A structure containing the same information from 'Data Statistics'
data_stats.min = min(data);
data_stats.max = max(data);
data_stats.mean = mean(data);
data_stats.median = median(data);
data_stats.mode = mode(data);
data_stats.std = std(data);
data_stats.range = data_stats.max - data_stats.min;
end

Plus de réponses (0)

Catégories

En savoir plus sur Calendar dans Help Center et File Exchange

Produits


Version

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by