%% Permute Matrix by Row or Column
% This example shows how to use the <docid:dsp_ref#f5-1257012 Permute
% Matrix> block to permute blocks by row or column.

% Copyright 2019 The MathWorks, Inc.

%%
% In the model, the top Permute Matrix block places the second row of the
% input matrix in the first and fifth rows of the output matrix. The block 
% places the third row of the input matrix in the three middle rows of the
% output matrix. The bottom Permute Matrix block places the second column
% of the input matrix in the first and fifth columns of the output
% matrix. It places the third column of the input matrix in the three
% middle columns of the output matrix. 
%% 
% Rows and columns of A can appear any number of times in the output, or 
% not at all depending on the index vector.
%%
model1 = "ex_permutematrix";
open_system(model1);
sim(model1);