The input matrix is tested in order to know of its diagonal is dominant.
T. R. (2020). Dominant Diagonal (https://www.mathworks.com/matlabcentral/fileexchange/28225-dominant-diagonal), MATLAB Central File Exchange. Retrieved .
Thank you for your comment Jan.
I wrote this some time ago and failed to optimize the code for fast/clean execution before submitting.
I will update this submission with your suggested improvements.
Help section with input, output, example, author and date. H1-like line not in the needed position to support LOOKFOR. Error checking of inputs. Useful and usable.
The efficiency could be remarkably increased by vectorizing the 2 FOR loops:
absDiag = abs(diag(A));
flag = all(sum(abs(A), 2) - absDiag < absDiag);
Then flag is a LOGICAL and not a DOUBLE.
H1 is now in the correct position.