EXPLANATION ::
CODE:
clc;
clear all;close all;
%% Given Data
A=[3,2;4,1];
B=[3,1;2,4];
C=[1,2 ;4,8];
D=[2,3;-3,8];
[eigenA,vectorA]=eigenandvector(A)
[eigenB,vectorB]=eigenandvector(B)
[eigenC,vectorC]=eigenandvector(C)
[eigenD,vectorD]=eigenandvector(D)
%
%% function to calculate
function [eigen,Vector]=eigenandvector(X)
I = eye(rank(X));
% Note X is a 2*2 matrix
% its eigen vales is det(X-lamda*I)=0
% that implies |(X(11)-lamda)*(X(22)-lamda)-X(12)*X(21)|=0
% which is second order equation given by
%
(lamda)^2-(X(11)+X(22))*lamda+((X(11)*X(22))-(X(12)*X(21))=0
% if we compare with second order equation
a=1;
b=-(X(1,1)+X(2,2));
c=(X(1,1)*X(2,2))-(X(1,2)*X(2,1));
% whos roots are (-b(+ or -)sqrt((b*b)-(4*a*c))/(2*a)
eigen(1)=(-b+sqrt((b*b)-(4*a*c)))/(2*a);
eigen(2)=(-b-sqrt((b*b)-(4*a*c)))/(2*a);
%% Eigen Vector Calculation
% for each eigen we get one vector as
% M*V=eigen*V
% for vector 1 we get equations as
% (X-eigen*I)*V=0
% by solving
%% For First Vector
m1=(X-(eigen(1)*I));
r1(1)=-m1(1,2)/m1(1,1);
r1(2)=-m1(2,2)/m1(2,1);
if r1(1)>1
Vector1(1)=1;
Vector1(2)=r1(2)*Vector1(1);
Vector1=[Vector1(1);Vector1(2)]
else
Vector1(2)=1;
Vector1(1)=Vector1(2)/r1(2);
Vector1=[Vector1(1);Vector1(2)];
end
%% For second vector
m2=(X-(eigen(2)*I));
r2(1)=-m2(1,2)/m2(1,1);
r2(2)=-m2(2,2)/m2(2,1);
if r2(1)>1
Vector2(1)=1;
Vector2(2)=r2(2)*Vector2(1);
Vector2=[Vector2(1);Vector2(2)]
else
Vector2(2)=1;
Vector2(1)=Vector2(2)/r2(2);
Vector2=[Vector2(1);Vector2(2)];
end
%% LETS COMBINE BOTH VECTORS
Vector=[Vector1,Vector2];
end
can u please on matlab, i have the solution on paper. [30pts] Write a robust, efficient...
You should test out your script using the following matrices. 2 3 1 2 3 1 C D- 3 2 B- A- -3 8 4 8 2 4 4 1 You may not use any special MATLAB tools. Instead, work symbolically and derive general expressions for the eigenvalues and the eigenvectors. For instance, you may not use the SOLVE function. If you are not sure whether or not a particular function is available to you, just ask Include your hand...
Can you help me with this question please? For the code, please do it on MATLAB. Thanks 7. Bonus [3+3+4pts] Before answering this question, read the Google page rank article on Pi- azza in the 'General Resources' section. The Google page rank algorithm has a lot to do with the eigenvector corresponding to the largest eigenvalue of a so-called stochastic matrix, which describes the links between websites.2 Stochastic matrices have non-negative entries and each column sums to1, and one can...
I need answers for question ( 7, 9, and 14 )? 294 Chapter 6. Eigenvalues and Eigenvectors Elimination produces A = LU. The eigenvalues of U are on its diagonal: they are the . The cigenvalues of L are on its diagonal: they are all . The eigenvalues of A are not the same as (a) If you know that x is an eigenvector, the way to find 2 is to (b) If you know that is an eigenvalue, the...
Matlab Homework Please write a script that does the following: generates a 3 x 5 matrix of random integersand call it A. generates a 3 x 3matrix of random integers and call it B. "Fix" A so it can be compared to B How do we "Fix" A? Make sure to reassign the value to A Tell me how many elements of A are greater than or equal to B This can be done in a single line. You will...
Please use MATLAB for the specified parts, I appreciate the help! 1. Complex Numbers and phasor analysis can be used to solve many problems. For example if we want to determine the currents of each of the voltage sources in the following circuit, VI ov then we can use a technique called mesh analysis to write mesh equations that involve the currents of each source. Let libe the current of the voltage source vl = 2 cos(t), I be the...
help wanted? Introduction to Engineering I Spring 2019 MATLAB Homework Assignment 1 a) Create a matrix called d from the third column of matrix a. (Hint, typing d 22: 5: 821 b) Combine matrix b and matrix d to create matrix e, a two-dimensional matrix with three rows c) Combine matrix b and matrix d to create matrix f, a one-dimensional matrix with six rows and d) Create matrix g from matrix a and the first three element of matrix...
For MATLAB users. Can you please type the answers for the MATLAB sections. Consider the RLC circuit where R - 5, C- 1, L- 4 and Vs - 8 1. Use circuit analysis laws to show that the resistor's voltage and induc- tor's voltage can be modelled as the system of ODEs Vi VL RC 2. Solve the eigenvalues and eigenvectors of the coefficient matrix in the system of ODEs. 3. Verify your answer for question (2) by using the...
NEED HELP WITH PROBLEM 1 AND 2 OF THIS LAB. I NEED TO PUT IT INTO PYTHON CODE! THANK YOU! LAB 9 - ITERATIVE METHODS FOR EIGENVALUES AND MARKOV CHAINS 1. POWER ITERATION The power method is designed to find the dominant' eigenvalue and corresponding eigen- vector for an n x n matrix A. The dominant eigenvalue is the largest in absolute value. This means if a 4 x 4 matrix has eigenvalues -4, 3, 2,-1 then the power method...
Question 3 (covers Unit 6) - 25 marks . Your answers to part (a) of this question must be shown with your own work . Part (b) and (c) of this question are required you to use Mathcad to compute your solutions. You must submit a copy or attached a copy of your Mathcad solutions to your tutor for marking (a) Consider the following matrix 2 1 -2 A-0 5 0 (i) Find three eigenvalues λ of A. One of...