res = trace(x)
| Parameter | Description |
|---|---|
| x | a numeric value: scalar or matrix (double or single) |
| Parameter | Description |
|---|---|
| res | a numeric value: a scalar |
trace(x) computes the trace of x, the sum of the elements along the main diagonal.
X = [1 0; 0 3];
Y = trace(X)
| Version | Description |
|---|---|
| 1.0.0 | initial version |