affecting a matrix rows as diagonal blocks in another matrix
Suppose i have a matrix A= [1 4 5
8 7 3
6 5 2]
I want to have a matrix B such each row of it has a row from A at the diagonal
B=[1 4 5 0 0 0 0 0 0
0 0 0 8 7 3 0 0 0
0 0 0 0 0 0 6 5 2]
how can i do it. I could do it with blkdiag but it supposes i input each row for the matrix, however i need something general since i need it for bigger matrices
"matlab " <firstname.lastname@example.org> wrote in message <email@example.com>...
> Su...Matrix of matrix
First of all, I apologize for my English, so please be indulgent with me if my sentences are not grammatically correct.
I have some trouble with MATLAB.
I have some data in txt files that I catch like that :
MFS93A1 = textread('Z:/Fichiers/MFS93.A1.txt','','headerlines',1);
MFS93B1 = textread('Z:/Fichiers/MFS93.B1.txt','','headerlines',1);
MFM77A1 = textread('Z:/Fichiers/MFM77.A1.txt','','headerlines',1);
MFM77C1 = textread('Z:/Fichiers/MFM77.C1.txt','','headerlines',1);
Then, in or...matrix in a matrix
I want to put a matrix that is 128X128 in a matrix that is 512X512 ( ones(512) ).
what I want to do is to have the white image and above to put the second image ( a letter, A for example).
I cant multiply cause they dont have the same dimensions.
thanks in advance
"th " <THOMITSU@YAHOO.COM> wrote in message <firstname.lastname@example.org>...
> hallo there.
> I want to put a matrix that is 128X128 in a matrix that is 512X512 ( ones(512) ).
> what I want to do is to have the white image and above ...Matrix in a matrix?
Hi to all,
I've encountered a problem using Matlab. As I'm not very familiar
with matlab, there are functions which I have not used before.
What I would like to know, if there is a way to express a matrix
within a matrix. For example,
R= [ r1 r2 r3 ... rn]
where rn=[xn yn tn]
and xn, yn, tn are column of numbers.
I used the following code below to express the numbers in rn as
coloumns for easy referencing.
xn=r(:,1); %represents the columns in the matrix
My objective is to be able to retrieve information in the matrix
easily and compare their values. Meani...matrix in matrix (?)
Hi, I need help!
I want to construct a matrix 10x10 where every element is a matrix
After, I need to extract the ?x2 matrix by the 10x10.
how to make that?
> Hi, I need help!
> I want to construct a matrix 10x10 where every element is a matrix
> After, I need to extract the ?x2 matrix by the 10x10.
> how to make that?
have a look at cell arrays. they provide the possibility to store
arbitrary data in an array like fashion.
Michael Wild wrote:
> mirus wrote:
>> Hi, I need help!
>> I want to constru...Empty matrix and Diagonal matrix
I want to creat a large diagonal matrix.The main diagonal elements
of the diagonal matrix is a 3x3 matrix.
For example I have a matrix A(3x3),now I should obtain the diagnoal
matrix B(300x300),can anybody tell me how to do it? Deeply appreciate
Thank you in advance!
Nandy Erik wrote:
> Hi everyone
> I want to creat a large diagonal matrix.The main diagonal
> of the diagonal matrix is a 3x3 matrix.
> For example I have a matrix A(3x3),now I should obtain the diagnoal
> matrix B(300x300),
>Others I want to know how to create an...a symmetric matrix left muliplies a matrix and right its transpose is not symmetric
I have one question about the symmetry of the matrix. Lets say we have a symmetric matrix A, then I?multiply a matrix B before A and B' after A, i.e. BAB', which should be also a symmetric matrix. However, in Matlab, BAB' is not symmetric. Is this simply a numerical error? Any way to overcome this instead of forcing it symmetric like imposing the upper (or lower) triangular part to the opposite side which can cause some further problems in later usage of the matrix(BAB') from my trial, e.g. a theoretically positive definite symmetric matrix is not positive anymore.
...How do I create a diagonal matrix with block matricies on the diagonal?
I need to create a square matrix that has square block matricies
along the diagonal and zeros everywhere else. That is to say, I need
to create a block diagonal matrix where each submatrix is different.
The overall matrix needs to have the form:
| sm1 0 0 |
| 0 sm2 0 |
| 0 0 sm3 |
Any advice would be greatly appreciated. Either post a reply or
email me directly(email@example.com).
thanks in advance,
phat phreak wrote:
> Hello all,
> I need to create a square matrix that has square block matricies
> along the diagonal and zeros everywhere el...Fast Matrix*Diagonal*Matrix operation
I have a code that computes Q'*D(t)*Q many times. Here Q is a fixed mxn matrix with m < n, while the diagonal matrix D depends on the iteration t.
Because I have so many iterations that the operation slows done the entire process.
I am wondering if there is any way to obtain Q'*D(t)*Q as fast as possible. Maybe from the result of Q'*Q or some kind of decomposition of Q'*Q?
Thanks in advance!
"Gongguo Tang" wrote in message <firstname.lastname@example.org>...
> Hi there,
> I have a code that compute...Creating a J*J Diagonal Matrix with Jth Diagonal element is also a matrix
I am a new beginner of Matlab and I want to create a Diagnoal Matrix with the main diagnoal as (A1,A2,A3,....,Aj) where Aj is also a matrix which is defined as (a11,a12,a13;a21,a22,a23;a31,a32,a33). How can I define Aj as a variable in the m file then create the diagnoal matrix through Aj?
Could someone help on this please? Many Thanks in Advance!
"Jie " <email@example.com> wrote in message <firstname.lastname@example.org>...
> I am a new beginner of Matlab and I want to create a Diagnoal Matrix with the main diagnoal as (A1,A2,A3,....,Aj) w...Is a matrix block diagonal?
How would you find whether a given symmetric matrix is block
diagonalizable (under shuffling of the indices)?
My matrix is very large, binary and symmetric. It is not sparse, it
has ~ 10% 1s. I want to find whether some indices cluster with
others, or whether the whole thing is irreducible.
Pedro Bordalo wrote:
> How would you find whether a given symmetric matrix is block
> diagonalizable (under shuffling of the indices)?
> My matrix is very large, binary and symmetric. It is not sparse,
> has ~ 10% 1s. I want to fi...block diagonal matrix
Does anybody know what is the most efficient way to cobstruct a diagonal matrix from a vector of entries?
For example I want to create:
1 0 0
0 2 0
0 0 3
"blkdiag" does not work here since I need to enter the vector elements one by one which I can't since "a" can be very large.
On 9/5/2013 3:16 PM, Elnaz wrote:
> Hi all,
> Does anybody know what is the most efficient way to cobstruct a diagonal
?matrix from a vector of entries?
> For example I want to create:
> 1 0 ...convert a non symmetric matrix to a square matrix
Happy new year.
I have a non symmetric matrix A which is (M x N) size. I want use inverse function "inv( )" for it . Is anybody help me how can I convert matrix A to a square Matrix.
On 30/12/10 4:46 AM, FARSHID wrote:
> I have a non symmetric matrix A which is (M x N) size. I want use
> inverse function "inv( )" for it . Is anybody help me how can I convert
> matrix A to a square Matrix.
There are a large number of useless ways to do that.
Perhaps you should consider using pinv() instead of inv().
On the...construct diagonal block matrix
I want to build a diagonal matrix such as
1 2 0 0 0 0
0 0 3 4 0 0
0 0 0 0 5 6
with a given (arbitrary) matrix,
without using loops and cell arrays (conversion takes time) blkdiag works with only parameters (a,b,c,d...) a,b,c,d... are row vectors.
I have a solution. Let
M = [1 2; 3 4; 5 6];
Then, the matrix you are looking for can be computed with the following two lines:
A = [diag(M(:,1)) diag(M(:,2))];
B = A(:,reshape(reshape(1:6,3,2)',1,6))
Hope this helps,
"Tim Yang" <dlISCool@gmail.com> wrote in message <h0u...