%% Extract Diagonal of Matrix
% This example shows how to use the <docid:dsp_ref#f3-940481 Extract Diagonal> block.

% Copyright 2019 The MathWorks, Inc.

%%
% Open the Simulink model.
model = "ex_extractdiagonals";
open_system(model);

%%
% The *Extract Diagonal* block returns the main diagonal of the input
% matrix. The main diagonal of the input matrix is [1,5,9]. 
%% 
% Run the model to verify.
sim(model);