Expand a matrix, MATLAB Programming

Expand a matrix:

To expand a matrix, an individual element could not be added as that would mean there would no longer be the similar number of values in every row.

Though, the whole row or column could be added. For illustration, the following would add a fourth column to the matrix:

>> mat(:,4) = [9 2]'

mat =

2 11 4 9

5  6 7 2

Now as we saw with vectors, if there is a gap between the present matrix and the row or column being added, the MATLAB will fill in with zeros.

>> mat(4,:) = 2:2:8

mat =

2   11   4   9

5    6    7   2

0    0    0   0

2    4    6   8

 

Posted Date: 10/18/2012 4:27:37 AM | Location : United States







Related Discussions:- Expand a matrix, Assignment Help, Ask Question on Expand a matrix, Get Answer, Expert's Help, Expand a matrix Discussions

Write discussion on Expand a matrix
Your posts are moderated
Related Questions
Introduction to File Input/output (LOAD and SAVE): In most cases, the input to a script will come from a data file which has been generated by the other source. It is also use

Input in a for Loop: The script below repeats the process of prompting the user for a number, and echo printing the number (that means simply printing it back out). A for loop


Show (turn in) similar output images as in part 2 for each of your new images (there is only 1 connected component in this case). Write three functions which compute the moments, c

Generate a script: To generate a script, click File, then New, and then M-file. The new window will appear known as the Editor. To generate a new script, simply type the serie

Hello my name is lalitkumar and I am a student.I needed help in MATLAB for recognition of colour randomly using webcam realtime for RGB without external trigger.please mail the co

Illustration of script Documentation: For illustration, the script to compute the area of a circle could be modified to have comments: The first comment at the startin

Customizing a Plot: Line Types, Color, Marker Types: Plots can be completed in the Command Window, if they are really simple. Though, at many times it is desirable to customiz

Some recent column source designs incorporate ‘beam steering', where the phase of each element in the column is varied in order to change the angle at which the major lobe appears.

Printing Vectors and Matrices: For vector, if the conversion character and newline character are in the format string, it will print in a column in spite of of whether the vec