How can I plug vector values into a matrix?

조회 수: 8 (최근 30일)
ms38
ms38 2020년 11월 6일
답변: Sreeranj Jayadevan 2020년 11월 17일
I have a matrix that depends on different x, y and z values. I want to put in different vector values in the matrix and make a series of calculations. How can I do this?
  댓글 수: 2
Rik
Rik 2020년 11월 6일
Do you mean you want to interpolate a 3D array? Can you provide a bit more explaination?
What have you tried?
ms38
ms38 2020년 11월 6일
Hi Rik, thank you for your reply. I realise now my question may have been unclear. Basically I am investigating a system of 3D ODES. I have a Jacobian matrix and I want to input different vectors in the matrix, so I can calculate the eigenvalues of these matrices and then then eventually plot the trace of the matrix. I have created a for loop for a series of 1 x 3 vectors (up to a 1000 vectors) and now I want to put those vector values in the Jacobian matrix. How can I do this? (Apologies if my question is still a little unclear or silly, I'm new to MATLAB so I'm still learning what is possible and what isn't).

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

답변 (1개)

Sreeranj Jayadevan
Sreeranj Jayadevan 2020년 11월 17일
If 'Vec' is your 1000 by 3 vector and it is of the form
[x1 y1 z1;
x2 y2 z2;
x3 y3 z3;
........
........
........]
and since you are finding the Jacobian matrix, you can replace the variable x with Vec(i,1), y with Vec(i,2) and z with Vec(i,3) within the Jacobian matrix and then loop through the variable 'i'. (i=1,2,3.....1000)
You can also go through the "jacobian" function and check if it helps with the problem at hand: https://in.mathworks.com/help/symbolic/jacobian.html

카테고리

Help CenterFile Exchange에서 Operating on Diagonal Matrices에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by