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
Write single MATLAB statements to create these vectors from any vector Z. You can use vector Z shown as a sample input. Create a single m-file script (non-function) to containing a

Function char: The function char does the opposite; it converts from any number type to the type char: >> char(numequiv) ans = a As the letters of the alphabet are

The IF-ELSE Statement: The if statement selects whether an action is executed or not. Selecting between the two actions, or selecting from numerous actions, is accomplished by

How to design a FIR filter using ANFIS in MATLAB

Implement a MatLab function to calculate y.  The function should take two input arguments 1) A vector of parameters In the above example this would be of length 3, the first

(a) Find the spectrum of this waveform:  x = [ exp( -[0:1:49]/10), exp(-[50:-1:1]/10)]. Subplot only the magnitude by using the spectrum program from the class notes. (b) Using

You are asked to create an american option multiplicative binomial model calculator in MatLab. Both put and call options should be valued. Given u, d, S 0 , K, r, and T (the usual

Example: Load from File and Plot Data: As illustration, a file known as timetemp.dat stores two lines of data. The first line is the time of the day, and the next line is the

People arrive at a microscope exhibit at a rate of one every 8+/- 2 minutes. Only one person can see the exhibit at a time. It takes 5 +/- 2 minutes to see the exhibit. A person

#question.i want to know the number of pixels related to the actual phase value and want to separate the zero phase valued pixels from the image..