フィルターのクリア

Saving figure data statistics without using the GUI?

1 回表示 (過去 30 日間)
Rose Lakatos
Rose Lakatos 2018 年 7 月 20 日
回答済み: Ryan Takatsuka 2018 年 7 月 20 日
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.

採用された回答

Ryan Takatsuka
Ryan Takatsuka 2018 年 7 月 20 日
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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeCalendar についてさらに検索

製品


リリース

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by