2 September 2013

Creation of matrix in matlab

As the name suggests MATLAB (Matrix Laboratory) , matrix is the vital part of MATLAB. so today i am going to tell you how to create different types of matrices in MATLAB.
Informally, the terms matrix and the array are often  used interchangeably. More precisely , a matrix is a two- dimensional rectangular  array of real or complex numbers that represents a linear transformation. The linear algebraic operations defined on matrices have found applications in a wide variety of technical fields.
MATLAB has dozens of functions that create different kinds of matrices. These commands you can try on your command window of MATLAB.
  1. A=magic(3)                   % creates random 3 by 3 matrix
  2. B=pascal(3)                  % creates symmetric matrix
  3. C=fix(10*rand(3,2))      % creates 3 by 2 rectangular matrix of random integers
  4. x=[7;8;9]                      % produce a column vector
  5. y=[4 5 -6]                     % produce a row vector
  6. z=2                               % produce a scalar
so from this code you can try and make your own matrix in MATLAB.

1 comment:

  1. Yes I learned and it is very helpful thanks...
    Keep Posting.....

    ReplyDelete

Factory Method Design Pattern in Java

The Factory Design Pattern is probably the most used design pattern in modern programming languages like Java.  Here we discuss about it an...