File Exchange

image thumbnail

Dominant Diagonal

version 1.3 (1.87 KB) by

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

2 Downloads

Updated

View License

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

Comments and Ratings (2)

T. R.

T. R. (view profile)

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 Simon

Jan Simon (view profile)

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

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
MATLAB 7.3 (R2006b)

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video