%% Generate Diagonal Matrix from Vector Input
% This example shows how to use the <docid:dsp_ref#f3-934059 Extract Diagonal> block.

% Copyright 2019 The MathWorks, Inc.

%%
% Open the Simulink model.
model = "ex_create_diagonal_matrix";
open_system(model);
sim(model);
%%
% The *Create Diagonal Matrix* block creates a diagonal matrix from the
% input values. The output matrix in the model has the input
% vector as its diagonal.
%%
% Run the model to verify the output.
