Question: how to define nxn matrix in matlab?
Answer: To initialize an N-by-M matrix, use the “zeros” function. For example, create a 3-by-5 matrix of zeros: A = zeros(3,5); You can then later assign specific values to the elements of “A”.