필터 지우기
필터 지우기

How to calculate Matrix A?! (Fitting or ...)

조회 수: 3 (최근 30일)
Peyman
Peyman 2014년 2월 25일
댓글: Peyman 2014년 2월 25일
Hello everyone,
I need to calculate Matrix A, as you can see in the photo I have attached. (my system is a lot bigger, I simplified it in several rows and columns so it can be understood easily)
I know it can be done by Fitting, however, I do not know how I can define matrix A for this purpose. In Fitting, we can define xdata=F2 and ydata=F1; but what about A?!
If also, you know any other method to calculate A, please let me know.
Thanks, Peyman
  댓글 수: 2
Danilo NASCIMENTO
Danilo NASCIMENTO 2014년 2월 25일
let me know first, you dont wanna type in the 49 elements of matrix A?
Peyman
Peyman 2014년 2월 25일
Thanks for the reply and specially for comments and suggestions.
- No, I don't want to type in all elements. They need to be calculated (and used later in another place)

댓글을 달려면 로그인하십시오.

답변 (1개)

John D'Errico
John D'Errico 2014년 2월 25일
You have a bi-diagonal matrix. One common trick is to use diag to create the main diagonal and then the sub-diagonal matrix, adding the two matrices together. Thus if a_main is a vector of main diagonal entries, and a_sub, the vector of the sub-diagonal entries...
a_main = rand(1,7);
a_sub = rand(1,6);
A = diag(a_main) + diag(a_sub,-1)A =
0.75774 0 0 0 0 0 0
0.27692 0.74313 0 0 0 0 0
0 0.046171 0.39223 0 0 0 0
0 0 0.097132 0.65548 0 0 0
0 0 0 0.82346 0.17119 0 0
0 0 0 0 0.69483 0.70605 0
0 0 0 0 0 0.3171 0.031833
Better is to learn to use sparse matrices, here the appropriate function is spdiags, which will create the complete matrix in one call. The nice thing about a sparse matrix is the storage savings as well as a speed boost for large problems.
  댓글 수: 1
Peyman
Peyman 2014년 2월 25일
- As I said, there is no limit to the matrix A; it changes with the system. And the aij also, are more than only two elements in each row, but the final matrix is still kind of a "lower triangular matrix".
- Did you just created two matrices with some numbers and then added them as matrix A? I get your point, but these aij arrays are coefficients in my equation and I want to find the coefficients.
- I can't have inverse matrix for F2(t) because it is not a square matrix! To find A, I need to use another approach. Do you have any opinion about this?

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Vector Spaces and Subspaces에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by