def linalg_vector_set_elem(a, n, v):
    """
    Set vector element n to v. Returns copy of matrix
    with change.

    Parameters:

    a (array): The vector
    n (int): The index
    v (number): The new value
    """
    a1 = a.copy()
    a1[n] = v
    return a1