Problem 1024. Doubling elements in a vector
Given the vector A, return B in which all numbers in A are doubling. So for:
A = [ 1 5 8 ]
then
B = [ 1 1 5 5 8 8 ]
Solution Stats
Problem Comments
-
6 Comments
Show
3 older comments
srisai vangara
on 29 Apr 2020
Really found a lot of trouble to find the solution.
But could not find how someone could solve it just using a size of 7.
Sivaramarao B
on 7 Jun 2020
good one
Kaiz Merchant
on 4 Aug 2020
What matlab functions are useful for this ? (I did it with a loop)
Michael Green
on 8 Feb 2021
Good problem if you don't use repelem
Javid Moraveji
on 4 Jun 2022
I think the test should also check for column vectors and any vector with special variables Inf and NaN
Mostafa
on 30 Dec 2022
Nice problem without using kron function
Solution Comments
Show commentsProblem Recent Solvers7124
Suggested Problems
-
681 Solvers
-
Permute diagonal and antidiagonal
425 Solvers
-
491 Solvers
-
370 Solvers
-
691 Solvers
More from this Author2
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!