Question

You can create a simple anonymous function eigenvalues sum by the following line of code and similarly, define eigenvalues pr

You can create a simple anonymous function

eigenvalues

sum

by the following line of code:

and similarly, define eigenvalues product by

Create at least five matrices and compute their eigenvalues sum, eigenvalues product, trace,

and determinant. (You may need to look up trace and determinant in the Mathworks docu-

mentation.) What, if anything, do you notice?

MATLAB: I need the code for everything in the picture, not just the bottom paragraph. Thanks!

0 0
Add a comment Improve this question Transcribed image text
Answer #1


%%Matlab function for eigen value sum matrix A A-randi(5,5); sum and product of eigen values [sum_eig,product eig]Feigenvalue

%%Matlab function for eigen value sum
%matrix A
A=randi(5,5);

%sum and product of eigen values
[sum_eig,product_eig]=eigenvalues_sum(A);

fprintf('For the matrix \n')
disp(A)

fprintf('\tSum of eigen values of A = %f\n',sum_eig)

fprintf('\tProduct of eigen values of A = %f\n',product_eig)

fprintf('\tDeterminant of A = %f\n',det(A));

function [sum_eig,product_eig]=eigenvalues_sum(A)

    %sum_eig= sum of eigen values;
    %product_eig= product of eigen values;
    %trace = trace of eigen values
    %det = determinant of eigen values
  
    ee=eig(A);
    sum_eig=sum(ee);
  
    product_eig=1;
    for ii=1:length(ee)
        product_eig=product_eig*ee(ii);
    end
  
end

%%%%%%%%%%%%%%%%%%%%%% End of Code %%%%%%%%%%%%%%%%%%%%%%%%

Add a comment
Know the answer?
Add Answer to:
You can create a simple anonymous function eigenvalues sum by the following line of code: and similarly, define eigenvalues product by Create at least five matrices and compute their eigenvalues sum,...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Compute sum of the four digits in your AccessID and print it out. Please initialize your...

    Compute sum of the four digits in your AccessID and print it out. Please initialize your access ID as input data by using “DC” syntax. Your output should be in this format: My AccessID is ab1234 The sum is 10 Paste your code and screenshot of the output. . . Please create a very, very simple program as I am only a beginner. You don't need to store the four digits as variables. This is what I have so far....

  • Please write the following code as simple as possible in python: You will need to define...

    Please write the following code as simple as possible in python: You will need to define a function with four arguments. Here is what I used: > def find_matches(file1.txt, output1.txt, strings, value): file1.txt will contain a list of various strings. The program must copy from the first argument, and it should be written in the second argument (the second file, "output1.txt"). The third and fourth arguments will determine which specific strings will be copied over to the second file. For...

  • 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 n...

    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...

  • Write you code in a way that you can compute any size matrix-vector product. However, I specifically want you to confirm...

    Write you code in a way that you can compute any size matrix-vector product. However, I specifically want you to confirm that the following product works correctly. Required to implement these functions: assignMat, assignVec, printMatVec, allocVec, and allocMat. As well as these function prototypes: double* mvp1(double* mat, double* vec, int n); double* mvp2(double** mat, double* vec, int n); Cannot take user input. Only has to work for a square matrix, so no need for rows/column variables. Just need variable n...

  • Using Swift playground and / or the command line for macOS (open Xcode, create a new...

    Using Swift playground and / or the command line for macOS (open Xcode, create a new Xcode project, macOS, command line tool), practice the following exercises: Exercise: Swift Variables Declare 2 variables/constants with some random values and any name of your choice Considering these 2 variables, one as a value of PI and other as a radius of circle, find the area of circle Print the area of circle Declare a string variable explicitly with value “Northeastern”. Declare a string...

  • In this lab you will code a simple calculator. It need not be anything overly fancy,...

    In this lab you will code a simple calculator. It need not be anything overly fancy, but it is up to you to take it as far as you want. You will be creating this program in three small sections. You have the menu, the performance of the basic arithmetic operations (Addition, Subtraction Multiplication, and Division), and the looping. You may want to get the switch menu working first, and then fill in the code for these four arithmetic operations...

  • For this project you will implement a simple calculator. Your calculator is going to parse infix...

    For this project you will implement a simple calculator. Your calculator is going to parse infix algebraic expressions, create the corresponding postfix expressions and then evaluate the postfix expressions. The operators it recognizes are: +, -, * and /. The operands are integers. Your program will either evaluate individual expressions or read from an input file that contains a sequence of infix expressions (one expression per line). When reading from an input file, the output will consist of two files:...

  • Can you me with; Designing an apple Watch Product All of you purchase products and services...

    Can you me with; Designing an apple Watch Product All of you purchase products and services every day, ranging from necessities, such as food, clothing, and shelter, to discretionary items, such as soda, music, and education. And marketers develop many of these products and services with you specifically in mind—just look at the stores in and around campus that cater to you.    Learning Objective. Define a target market and develop an apple watch product. Defining an apple watch Product....

  • Please explain each line of code, all code will be in Java. Thank you JKL Restaurant...

    Please explain each line of code, all code will be in Java. Thank you JKL Restaurant maintains a members’ club for its customers.  There are three levels of membership: (1) Basic, (2) Silver, and (3) Gold. A certain member has to be exactly a Basic, Silver, or Gold member at any point in time.  Whenever a member spends money at JKL, he/she gets points and as these points are accumulated, one can redeem one or more $20 dining certificates.  Each Gold member can...

  • You will develop an E-Commerce database used to maintain customers, products and sales information. You are...

    You will develop an E-Commerce database used to maintain customers, products and sales information. You are required to 1) gather and analyze requirements 2) design logical structure of the database 3) create stored procedures to develop the tables and insert the data 4) write SQL statements for data extraction and reporting. Throughout the course of this semester you have analyzed the requirements for an eCommerce database, designed and developed your database. As a class we have gone through the process...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT