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
Ant Colony Optimization for Optimization of Route path taken Ant Colony Algorithm is a potential candidate for coupled, 3D optimisation. Ant Colony Algorithm enjoys the overall

How do you write a programme that asks the user for a number between 1 and 1000 and calculates the sum of its digits?

Write a MATLAB program to find the undamped natural frequencies and modes of an electric car treating it as a four degree of freedom system. Determine the undamped natural frequenc

Consider the function: f(x) = 7 - 28x + 42x 2 - 28x 3 + 7x 4 : Write a script findPolyRoot.m to nd, as accurately as you can, the root of f(x) near x = 2. Your script mu

I am doing project "Recognizing people in video based on their body" the system will use MATLAB to detect people based on thier body and then recognize them from their clothes "us

Write a MATLAB program that calculates the arithmetic mean, and the root-mean-square average for a given set of values. The output should be formatted as follows: Y

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

how can i write a programm about maze solver expert system only with if & then

There are many approaches to numerically estimating the derivative of the function.  The relationship:   is called a forward difference, since the estimate of the derivativ

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