Functions to create special matrices, MATLAB in Mathematics

Functions to create special matrices:

The MATLAB also has various functions which create special matrices. For illustration, the zeros function generates a matrix of all zeros. Similar to rand, either one argument can be passed (that will be both the number of rows and columns), or two arguments (at first the number of rows and then the number of columns).

 

>> zeros(3)

ans =

0 0 0

0 0 0

0 0 0

>> zeros(2,4)

ans =

0 0 0 0

0 0 0 0

 

 

Posted Date: 10/18/2012 4:21:03 AM | Location : United States







Related Discussions:- Functions to create special matrices, Assignment Help, Ask Question on Functions to create special matrices, Get Answer, Expert's Help, Functions to create special matrices Discussions

Write discussion on Functions to create special matrices
Your posts are moderated
Related Questions
Program of built-in factorial function: Calling this function yields similar result as the built-in factorial function: >> fact(5) ans =   120 >> factorial(

Example of Minimum and Maximum Value For matrices, the functions min and max operate column wise by the default: >> mat = randint(2,4,[1 20]) mat =    9   10   1

Fliplr function: The fliplr function "flips" the matrix from left to right (in another words the left-most column, the first column, become the last column and so on), and the

Differentiation: The derivative of a function y = f(x) can be written as follows or f  '(x) and is defined as the rate of change of the dependent variable y with respe

Structure Consisting of the Fields A MATLAB can also solve the sets of equations. In this illustration, the solutions for x, y, & z are returned as a structure consisting of th

Complex numbers: A complex number is commonly written in the form z = a + bi here a is known as the real part of the number z, b be the imaginary part of z, and i is √-1

Function fopen - file function: The permission string in the call to the fopen function identifies that the file is opened for writing to it. Just as when reading from a file,

Error-Checking for Integers: As MATLAB uses the type double by default for all the values, to check to make confirm that the user has entered an integer, the program have to c

Indexed empty matrix: The Individual elements cannot be eliminated from matrices, as matrices always have the similar number of elements in every row. >> mat = [7 9 8; 4 6

Function xlsread - file function: The function xlsread will read from the spreadsheet file. For illustration, to read from file just generated: >> ssnums = xlsread('ranexc