sampleSummary
クラス: matlab.unittest.measurement.MeasurementResult
名前空間: matlab.unittest.measurement
配列 MeasurementResult
から要約統計量の table を作成
構文
T = sampleSummary(R)
入力引数
R
— 結果の配列
MeasurementResult
配列
テスト スイートで測定実験を実行した結果の配列。配列 MeasurementResult
として指定します。
出力引数
T
— 測定サンプルの要約
table
測定サンプルの要約。table として返されます。この table には、Name
、SampleSize
、Mean
、StandardDeviation
、Min
、Median
、Max
の列があります。
例
要約統計量の table を生成
現在の作業フォルダーに、さまざまな事前割り当てメソッドを比較するクラスベースのテスト 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 コマンド
次の MATLAB コマンドに対応するリンクがクリックされました。
コマンドを MATLAB コマンド ウィンドウに入力して実行してください。Web ブラウザーは MATLAB コマンドをサポートしていません。
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- 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)