Main Content

ModelAdvisor.Table

モデル アドバイザーの結果に対するテーブルの作成

説明

ModelAdvisor.Table オブジェクトはモデル アドバイザーの結果にテーブルを作成して書式設定します。テーブル タイトルとテーブルの見出し行を除く、テーブル内の行数と列数を指定します。

作成

説明

table = ModelAdvisor.Table(row,column) は指定した行数および列数を含む table オブジェクトを作成します。

入力引数

すべて展開する

モデル アドバイザーの結果テーブルに作成する行数。

モデル アドバイザーの結果テーブルに作成する列数。

オブジェクト関数

getEntryモデル アドバイザー解析結果のテーブルからセルの内容を取得
setColHeadingモデル アドバイザー解析結果のテーブルの列タイトルを指定
setColHeadingAlign列タイトルの配置の指定
setColHeadingValign列タイトルの垂直方向の配置を指定
setColWidth列幅の指定
setEntriesSpecify contents of table in Model Advisor analysis results
setEntryモデル アドバイザー解析結果でテーブルのセル内容を指定
setEntryAlignモデル アドバイザー解析結果でテーブルのセルの配置を指定
setEntryValignテーブル セルの垂直方向の配置を指定
setHeadingモデル アドバイザー解析結果でテーブルのタイトルを指定
setHeadingAlignテーブル タイトルの配置の指定
setRowHeadingテーブルの行タイトルの指定
setRowHeadingAlignテーブル行タイトルの配置の指定
setRowHeadingValignテーブルの行タイトルの垂直方向の配置を指定

すべて折りたたむ

モデル アドバイザーの結果に表示するテーブルを作成します。このテーブルにはランダムに生成された数を含む 5 つの行と 5 つの列があります。

コールバック関数内で以下の MATLAB® コードを使用します。モデル アドバイザーは結果に table1 を表示します。

matrixData = rand(5,5) * 10^5;

% Initialize a table with 5 rows and 5 columns (heading rows not counting).
table1 = ModelAdvisor.Table(5,5);

% Set column headings
for n=1:5
    table1.setColHeading(n, ['Column ', num2str(n)]);
end

% Center the second column heading
table1.setColHeadingAlign(2, 'center');

% Set column width of the second column
table1.setColWidth(2, 3);
 
% Set the row headings
for n=1:5
    table1.setRowHeading(n, ['Row ', num2str(n)]);
end

% Enter table content
for rowIndex=1:5
    for colIndex=1:5
        table1.setEntry(rowIndex, colIndex, ...
            num2str(matrixData(rowIndex, colIndex)));
        
        % set alignment of entries in second row
        if colIndex == 2
            table1.setEntryAlign(rowIndex, colIndex, 'center');
        end
    end
end

% Overwrite the content of cell 3,3 with a ModelAdvisor.Text  object
text = ModelAdvisor.Text('Example Text'); 
table1.setEntry(3,3, text)

The table "table1" with the text 'Example Text' in Row 3 Column 3

バージョン履歴

R2006b で導入