Eigenvalues and eigenvectors of 4 systems of ODe

clear all; clc format long %construct the matrix A. A=[0.00022 -0.0001 0 0; 0 0.1877 -0.1876 0; 0.32139 -0.32139 0.33212 -0.31817; -0.0000005 0 0 0.0001]; M=det(A); %Find the eigenvalues and eigenvectors of A by using eig. %This command gives AQ=QD. [Q,D] = eig(A); lambda1 = D(1,1); lambda2 = D(2,2); lambda3 = D(3,3); lambda4 = D(4,4); %Extract each colomn vector as an eigenvector of A. x_1 = Q(:,1); x_2 = Q(:,2); x_3 = Q(:,3); x_4 = Q(:,4);
%Display the result with long digits. format long; disp('lambda1 is '); disp(lambda1); disp('the eigenvector corresponding to lambda1 is'); disp(x_1); disp('lambda2 is '); disp(lambda2); disp('the eigenvector corresponding to lambda2 is'); disp(x_2); disp('lambda3 is '); disp(lambda3); disp('the eigenvector corresponding to lambda3 is'); disp(x_3); disp('lambda4 is '); disp(lambda4); disp('the eigenvector corresponding to lambda4 is'); disp(x_4); Please, what code do I use to
1. formulate matrix of the lambdas with their corresponding eigenvectors.
2. Find the determinant of the matrix to be formulated in 1.
3. Inverse of the matrix to be formulated in 1. @Walter Roberson. @Sam Chak
@Torsten @Star Strider
Please help me with the solutions
Thanks

5 Comments

This sounds like a homework assignment. If it is, show us the code you've written to try to solve the problem and ask a specific question about where you're having difficulty and we may be able to provide some guidance.
If you aren't sure where to start because you're not familiar with how to write MATLAB code, I suggest you start with the free MATLAB Onramp tutorial to quickly learn the essentials of MATLAB.
If you aren't sure where to start because you're not familiar with the mathematics you'll need to solve the problem, I recommend asking your professor and/or teaching assistant for help.
Also please format your code (edit your message, select the code, and press the first button in the Code section of the toolstrip) to make it easier to read.
The code is there, I only needed the code to formulate a matrix form the Eigenvalues with their corresponding eigenvectors and then find the determinant and it's inverse.
Please format the code.
In the editor here, click on the ">" button in the CODE portion of the ribbon. Then past your code from your editor into the region that was just created. (Remember to remove the old unformatted code.)
I wonder how OP copied and pasted the MATLAB code, but it automatically removed the hidden 'newline characters', making the code unformatted. Could OP have pasted the MATLAB code as plain text? However I don't the "paste as plain text" feature in the browser.
Users should click on the > button in the CODE section of the ribbon at the top of the editor area. Then they should copy and paste into the area that the > button created.
Pasting code into a > area typically automatically applies indentation. If you have pre-formatted code that you do not want the automatically-applied indentation to change, then immediately after pasting the code in, press control-Z (⌘-Z on Mac) and that will undo the automatic indentation without undoing the code insertion.

Sign in to comment.

Answers (0)

Categories

Find more on Loops and Conditional Statements in Help Center and File Exchange

Products

Release

R2007b

Tags

Asked:

on 2 Dec 2023

Commented:

on 9 Dec 2023

Community Treasure Hunt

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

Start Hunting!