I encountered some numerical questions when running simulation on MatLab. Here please find the questions:
I found that
A*A'
(a matrix times its transpose) is not guaranteed to be symmetric in MatLab. Can I know what is the reason? And because I will haveA*C*A'
, whereC
is a symmetric matrix, and I would like to keepA*C*A'
as symmetric. Is there any method to fix the numerical difference created by the transpose operation?I implemented a for loop in Matlab to compute a set of matrices. Small numerical difference (around
10^(-10)
) in each round accumulates to the next run, and it finally diverges after around 30 rounds. Is there any method to fix small error in each run and do not affect the result at the same time.
Thank you for reading my questions!