# eigmin

eigmin(A)

Returns the smallest eigenvalue of `A`.

## Examples

In the Julia programming language, the function `eigmin(A)` returns the smallest eigenvalue of matrix `A`.

``````julia> A = [1 2; 3 4];
julia> eigmin(A)
-0.3722813232690143``````

Here are some examples of how to use `eigmin`:

1. Find the smallest eigenvalue of a matrix:

``````julia> M = [5 2; 1 -3];
julia> eigmin(M)
-4.854101966249686``````

This example computes the smallest eigenvalue of the matrix `M`.

2. Calculate the smallest eigenvalue of a symmetric matrix:

``````julia> A = [4 1 2; 1 2 5; 2 5 3];
julia> eigmin(A)
-3.964279792751168``````

It computes the smallest eigenvalue of the symmetric matrix `A`.

3. Handle edge case with a 1x1 matrix:
``````julia> B = [7];
julia> eigmin(B)
7.0``````

When the matrix is a scalar (1x1 matrix), the function returns the value itself.

Common mistake example:

``````julia> C = [1 2; 2 1];
julia> eigmin(C)
ERROR: LinearAlgebraException("eigmin only supports Hermitian or symmetric matrices")``````

In this example, the function throws an error because `eigmin` only supports Hermitian or symmetric matrices. It's important to ensure that the matrix provided is of the correct type to avoid such errors.