Insert vector into matrix at specific columns
问题 How would I insert a vector b into a matrix at column col? I cannot find any syntax for and insert or append function in Fortran. So far all I have done is reassigned the values in the column, but I only want to insert the vector. real :: M(n,n) integer :: n, col real :: b(n) M(n:col) = b(:) 回答1: If I understood of your problem, you want to: increase the number n of columns of the matrix m by 1; insert the content of a vector b in m as a new column, at index col ; right-shift the remaining