Matrix theory basics 2.5 basic matrix calculation using Matlab

Source: Internet
Author: User

Section 5 basic matrix calculation using Matlab

MATLAB mathematical software can perform various complex operations on the matrix. Below are some examples of simple operations.

Example 18: generate a matrix. Set

Solution: MATLAB has many functions to generate different types of matrices. When you input the following commands in the MATLAB window, all elements of the matrix must be in a pair of square brackets, different elements in the same row are separated by commas (,) or spaces, and different rows are separated by semicolons (;). If you do not end with a semicolon after the input, the input content is not displayed and ended with a semicolon, displays the input result immediately.

> A = [, 7;-, 9;, 1]

A =

> B = [3; 1; 4]

> C = [2, 0,-1]

C =

Example 19 known

Solution: Enter the following command in the MATLAB window:

> A = [1,-; 2,-; 3,-];

> B = [3,-;, 1; 1,-];

> X = a + B

X =

> Y = AB

Y =

Example 20

Solution: Enter the following command in the MATLAB window:

> A = [3,-,-1;,; 1,-, 2;,];

> DETA ------ the determinant function of the matrix is det ()

Ans = 4

> A' ------ calculate the transpose of the matrix. Use single quotation marks directly and use a' instead of

Ans =

> Inv (a) ------ calculate the Inverse Matrix Function of the matrix as inv ()

Ans =

> A ^ 2

Ans =

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.