sampleSummary
クラス: matlab.unittest.measurement.MeasurementResult
名前空間: matlab.unittest.measurement
配列 MeasurementResult から要約統計量の table を作成
構文
T = sampleSummary(R)
入力引数
テスト スイートで測定実験を実行した結果の配列。配列 MeasurementResult として指定します。
出力引数
測定サンプルの要約。table として返されます。この table には、Name、SampleSize、Mean、StandardDeviation、Min、Median、Max の列があります。
例
現在の作業フォルダーに、さまざまな事前割り当てメソッドを比較するクラスベースのテスト preallocationTest.m を作成します。
classdef preallocationTest < matlab.perftest.TestCase methods(Test) function testOnes(testCase) x = ones(1,1e7); end function testIndexingWithVariable(testCase) id = 1:1e7; x(id) = 1; end function testIndexingOnLHS(testCase) x(1:1e7) = 1; end function testForLoop(testCase) for i=1:1e7 x(i) = 1; end end end end
テスト スイートを作成します。
suite = testsuite('preallocationTest');
可変数のサンプル測定により時間実験を構築して、テストを実行します。
import matlab.perftest.TimeExperiment
experiment = TimeExperiment.limitingSamplingError;
R = run(experiment,suite);
Running preallocationTest .......... .......... .......... .......... .......... ..... Done preallocationTest __________
結果の配列 R から要約統計量の table を作成します。
T = sampleSummary(R)
T =
4×7 table array
Name SampleSize Mean StandardDeviation Min Median Max
__________________________________________ __________ ________ _________________ ________ ________ ________
preallocationTest/testOnes 4 0.02649 0.00086703 0.025583 0.026426 0.027526
preallocationTest/testIndexingWithVariable 16 0.13356 0.014525 0.11803 0.12716 0.15946
preallocationTest/testIndexingOnLHS 13 0.073571 0.0073962 0.065024 0.073216 0.086889
preallocationTest/testForLoop 6 0.74768 0.03897 0.69934 0.75511 0.79957
バージョン履歴
R2017a で導入
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Web サイトの選択
Web サイトを選択すると、翻訳されたコンテンツにアクセスし、地域のイベントやサービスを確認できます。現在の位置情報に基づき、次のサイトの選択を推奨します:
また、以下のリストから Web サイトを選択することもできます。
最適なサイトパフォーマンスの取得方法
中国のサイト (中国語または英語) を選択することで、最適なサイトパフォーマンスが得られます。その他の国の MathWorks のサイトは、お客様の地域からのアクセスが最適化されていません。
南北アメリカ
- América Latina (Español)
- Canada (English)
- United States (English)
ヨーロッパ
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)