File Exchange

image thumbnail

Dominant Diagonal

version 1.3.0.0 (1.87 KB) by T. R.
The input matrix is tested in order to know of its diagonal is dominant.

8 Downloads

Updated 20 Jul 2010

View License

The input matrix is tested in order to know of its diagonal is dominant.

Cite As

T. R. (2020). Dominant Diagonal (https://www.mathworks.com/matlabcentral/fileexchange/28225-dominant-diagonal), MATLAB Central File Exchange. Retrieved .

Comments and Ratings (3)

wenlong

T. R.

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.

Jan

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.

Updates

1.3.0.0

H1 is now in the correct position.
More efficient (vectorized) implementation.
Output is now returned as LOGICAL.
Input can now be tested for diagonal dominance or strict diagonal dominance.

MATLAB Release Compatibility
Created with R2006b
Compatible with any release
Platform Compatibility
Windows macOS Linux