RollingEEE
Full Member level 3
- Joined
- Mar 25, 2006
- Messages
- 165
- Helped
- 8
- Reputation
- 16
- Reaction score
- 7
- Trophy points
- 1,298
- Location
- Bangladesh
- Activity points
- 2,406
matlab repeat vector
Hi,
I am looking for a code that will repeat each column of a vector to produce a new vector. My code is extremely time consuming. Even matlab suggests not to use an array that gradually 'blows up'
Can any one help?
Hi,
I am looking for a code that will repeat each column of a vector to produce a new vector. My code is extremely time consuming. Even matlab suggests not to use an array that gradually 'blows up'
Code:
function y = expand(b, m)
A = [];
n = length(b);
for i = 1:n
A = [A ones(1, m) .* b(:, i)];
end
y = A;
Can any one help?