Simulating using random orthogonal matrices. How can i create a massive matrix from an equation containing several random matrices and fixed matrices?
1 view (last 30 days)
Show older comments
I need to create a massive matrix via the eqn: X= Q*L*R*An
where Q and R are random matrices, and L and An are fixed.
I am able to calculate X once, however, what id like to do is the following procedure:
1. Generate Q and R 2. Calculate X 3. Generate new Q and R 4. Calcluate X2 and then merge X2 with X,( to create Xstar) i.e a continuation of X. So that if X=2000*3 and X2= 2000*3 then Xstar=4000*3
Any idea? here som of my code: m=2000 n=3 m and n are matrix dimensions
L=some fixed matrix(2000,3); An=some fixed matrix(3,3);
R=(gallery('randhess',n)); %Upper hessenberg
I=speye(m); % Make Imm Q=I(:,randperm(m));
%Finally compute the equation
X=M*Q*L*R*An;
I suppose i should use a for loop somehow
Any idea? help is much appreciated
0 Comments
Accepted Answer
Thorsten
on 21 Jan 2013
for i = 1:N
M = ...
Q = ...
L = ...
R = ...
An = ...
if i == 1
X = M*Q*L*R*An;
else
X = [X ; M*Q*L*R*An]
end
end
0 Comments
More Answers (0)
See Also
Categories
Find more on Creating and Concatenating Matrices in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!