Evaluation of matrix element of a linear differential matrix equation by constrained least square fitting
2 次查看(过去 30 天)
显示 更早的评论
Hi All,
I was trying to evaluate the matrix coefficient by the method of constrained least square fitting. The linear matrix differential equation looks like X'=AX, where X' and X are two vectors and A is matrix. Moreover, there is a constraint on diagonal matrix element and which is a(i,i)=-Sum(i/=j)a(i,j). The elements of X' and X vectors are known. I was trying to use MATLAB to do that. But I didn't figure out which figure out which MATLAB function is suitable for that. Can you guide me in this regard.
Thanks in advance Sudipta
0 个评论
采纳的回答
Richard Brown
2013-8-7
Assuming you have multiple X and X' vectors that you're trying to fit your matrix to, your problem can be posed as a constrained linear least squares problem in the entries of A, which can be solved using lsqlin
3 个评论
Richard Brown
2013-8-7
The vector that you get out from lsqlin will be the columns of A, stacked into a vector. The matrix Ahat that you provide to lsqlin will be big (it's not A). For example, assuming your vectors have m entries and A is square, the first m rows of the matrix Ahat you provide to lsqlin will be
tmp = repmat({x1},m,1);
Ahat(1:m,:) = blkdiag(tmp{:})
where x1 is your first X vector. Likewise the first m entries of the RHS will be xp1 (your first X' vector)
更多回答(1 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Linear Least Squares 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!