Jiayi's profile五棵松树洞PhotosBlogListsMore Tools Help

Blog


    Not a big fans of MATLAB

    Matrix Inversion with Excel

    Copy from http://faculty.kfupm.edu.sa/SE/salamah/matrix/index.htm

    While doing my homework 5 of Applied Colorimetry, I find it's pretty handy to do simple matrix calculation (inversion and multiplication) in Excel rather than coding in MATLAB. Following is the step-by-step procedure available on http://faculty.kfupm.edu. Enjoy!

    Suppose you want to find the inverse of the matrix

    And you want to use Excel to assist you in finding the inverse.  Well, Excel can do that for you.  However, you have to do certain things in order for Excel to do its job.  The first thing you need to do is to enter the matrix in the worksheet; entering the matrix in the worksheet is a matter of typing the numbers (elements) of the matrix, each element in a separate cell.  So, open up Excel and start entering the numbers as shown in the figure below:

    matrix in Excel

    Once you entered the elements of the matrix, you can invoke the MINVERSE function which computes the inverse of the matrix.  Before you invoke the function, you have to highlight an area of cells with equal number of rows and columns as the matrix you like to invert.  In the figure below, I highlighted an area of 3 rows and 3 columns:

    Type the equal sign "=" before you click anywhere, like this:

    Once you are done, click on "Insert Function" button on the left side of the Formula Bar:

    insert function

    Clicking on "Insert Function" button opens up the "Insert Function" dialog box:

    insert function

    From the "Or select a category:" menu right below and to the left of the "Go" button, choose "Math & Trig":

    insert function

    And from the "Select a function:" list, choose "MINVERSE":

    minverse

    Once you clink on "OK" button, the "Function Arguments" dialog box comes up:

    minverse bos

    Now go ahead and select the cells that contain the matrix you like to find the inverse of:

    minverse box

    That last thing you have to do before you get the inverse of the matrix is to press and hold the ‘Ctrl’ and ‘Shift’ keys and then press the ‘Enter’ key.  Excel will now fill the area you selected to hold the inverse of the matrix with the inverse:

    matrix inverse in Excel

    And that’s the end of it.

    There are some shortcuts to all of this.  Assume that you want to find the inverse of another matrix, all what you have to do now is to select the proper size of cells, type "=", and from left upper corner below the standard toolbar, click on the name of the function you just used, in this case, it is "MINVERSE":

    shortcut to minverse

    Matrix Multiplication with Excel

    You want to multiply two matrices such as the matrix and a one-column matrix:

    You know the result of the multiplication is a 3 ´ 1 matrix because the first matrix is 3 ´3 and the second matrix is 3´ 1. Excel can do the multiplication for you also. The first thing you have to do is to enter the elements the two matrices into the worksheet:

    multiply matrices in Excel

    Now, go ahead and highlight an area of cells equal to the size of the matrix which is the result of the multiplication; in your case, you need to highlight 3 rows and one column:

    Type the equal sign "=" before you click anywhere:

    Now, go and click on "Insert Function" and choose from the "or select a category" menu "Math & Triq" category.   From the "Select a function" list, search for and choose "MMULT":

    mmult

    Click on "OK" button.  After that, the "Function Arguments" dialog box comes up:

    mmult

    In the "Array 1" field, enter the range of the first matrix by highlighting the cells that hold the matrix.  Then, click on the "Array 2" field and enter the range of the second matrix in the same way you did for the first field:

    mmult

    Press and hold the ‘Ctrl’ and ‘Shift’ keys and then press the ‘Enter’ key.  Excel will then give you the result of multiplying the two matrices:

    You can use the shortcut as explained earlier to call the "MMULT" function.

    Comments (2)

    Please wait...
    Sorry, the comment you entered is too long. Please shorten it.
    You didn't enter anything. Please try again.
    Sorry, we can't add your comment right now. Please try again later.
    To add a comment, you need permission from your parent. Ask for permission
    Your parent has turned off comments.
    Sorry, we can't delete your comment right now. Please try again later.
    You've exceeded the maximum number of comments that can be left in one day. Please try again in 24 hours.
    Your account has had the ability to leave comments disabled because our systems indicate that you may be spamming other users. If you believe that your account has been disabled in error please contact Windows Live support.
    Complete the security check below to finish leaving your comment.
    The characters you type in the security check must match the characters in the picture or audio.

    To add a comment, sign in with your Windows Live ID (if you use Hotmail, Messenger, or Xbox LIVE, you have a Windows Live ID). Sign in


    Don't have a Windows Live ID? Sign up

    lulu luluwrote:
    MATLAB是用来算大矩阵或者病态矩阵之类运算的,那时excel就不行了^_^
    Oct. 28
    Xiaoxi Lingwrote:
    好学生应该拿纸笔出来好好算
    每次看到矩阵就想到那个因为治疗白血病而谢顶又有点虚胖上课不得不带假发长得像典型抗日爱国电影里的汉奸的老师
    Oct. 28

    Trackbacks

    The trackback URL for this entry is:
    http://gretscher.spaces.live.com/blog/cns!139C9DF6FBD49A57!3615.trak
    Weblogs that reference this entry
    • None