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

Plot Functions: Faraway, we have plotted to generate two-dimensional plots and bar to generate bar charts. We have seen how to clear the Figure Window by using clf, and how to

Use of logical vector: Determine how many elements in the vector vec were greater than 5, the sum function can be used on the resulting vector isg: >> sum(isg) ans =

Blanks function: The blanks function will generate a string consisting of n blank characters-that are kind of hard to see here! Though, in a MATLAB if the mouse is moved to hi

Illustration of Minimum and Maximum Value Both of these functions also return the index of the minimum or maximum value; when there is more than one occurrence, it returns the

Strings as matrix: The matrix can be generated, that consists of strings in each row. Therefore, essentially it is created as a column vector of strings, but the final result

Illustration of Writing to files: Here is the other illustration in which a matrix is written to a file. At First, an arbitrary 2 × 4 matrix is generated, and then it is writt

Pie chart - plot functions: The MATLAB also has a function pie which will generate a pie chart. Calling the function with the form pie (vec) draws a pie chart, by using the pe

Empty Vectors: An empty vector or in another words, a vector which stores no values, can be generated using the empty square brackets: >> evec = [] evec = [] >> lengt

Sorting The Sorting is a process of putting a list in order; either in descending (maximum to minimum), or ascending (minimum to maximum) order. For illustration, here is a li