how to optimize block toeplitz matrix ?
how to optimize block toeplitz matrix in matlab
I want to create a block lower triangular with block teoplitz matrice starting from second column
in code
block_size1= nts * npt;
% Construct Block Matrices
[tp] = cell(nts, nts);
tp{1} = zeros(npt); tp{2} = zeros(npt);for n=3:nts, tp{n}=rand(npt);end
A_T = sparse(block_size1, block_size1);
for col = 2:nts
for row = col:nts
rowStart = (row – 1) * npt + 1;
rowEnd = rowStart + npt – 1;
colStart = (col – 1) * npt + 1;
colEnd = colStart + npt – 1;
A_T(rowStart:rowEnd, colStart:colEnd) = tp{row – col + 2};
end
end
we know that MATLAB does have a built-in function like toeplitz for cell arrays of matrices, but I want to optimize this code to:
Minimize computation time.
Reduce memory usage (if possible).how to optimize block toeplitz matrix in matlab
I want to create a block lower triangular with block teoplitz matrice starting from second column
in code
block_size1= nts * npt;
% Construct Block Matrices
[tp] = cell(nts, nts);
tp{1} = zeros(npt); tp{2} = zeros(npt);for n=3:nts, tp{n}=rand(npt);end
A_T = sparse(block_size1, block_size1);
for col = 2:nts
for row = col:nts
rowStart = (row – 1) * npt + 1;
rowEnd = rowStart + npt – 1;
colStart = (col – 1) * npt + 1;
colEnd = colStart + npt – 1;
A_T(rowStart:rowEnd, colStart:colEnd) = tp{row – col + 2};
end
end
we know that MATLAB does have a built-in function like toeplitz for cell arrays of matrices, but I want to optimize this code to:
Minimize computation time.
Reduce memory usage (if possible). how to optimize block toeplitz matrix in matlab
I want to create a block lower triangular with block teoplitz matrice starting from second column
in code
block_size1= nts * npt;
% Construct Block Matrices
[tp] = cell(nts, nts);
tp{1} = zeros(npt); tp{2} = zeros(npt);for n=3:nts, tp{n}=rand(npt);end
A_T = sparse(block_size1, block_size1);
for col = 2:nts
for row = col:nts
rowStart = (row – 1) * npt + 1;
rowEnd = rowStart + npt – 1;
colStart = (col – 1) * npt + 1;
colEnd = colStart + npt – 1;
A_T(rowStart:rowEnd, colStart:colEnd) = tp{row – col + 2};
end
end
we know that MATLAB does have a built-in function like toeplitz for cell arrays of matrices, but I want to optimize this code to:
Minimize computation time.
Reduce memory usage (if possible). toeplitz, optimization, code generation MATLAB Answers — New Questions