I want to repeat every element of a column array (10rows,1column) four times, and put all together in one column array.. please suggest any method
1 次查看(过去 30 天)
显示 更早的评论
eg: t(10,1)=[1;2;3;4;5;6;7;8;9;10] and i want result=[1;1;1;1;2;2;2;2;3;3;3;3;4;4;4;4;5;5;5;5;6;6;6;6;7;7;7;7;8;8;8;8;9;9;9;9;10;10;10;10]
please any body suggest the way out thank you
0 个评论
回答(4 个)
Alexandra Harkai
2016-12-2
repelem(t, 4)
4 个评论
Guillaume
2016-12-3
repelem was introduced in R2015a. It is a good idea to mention which matlab version you're using in the question particularly when it's that out of date.
Mohammed Yousuf
2016-12-3
1 个评论
Jan
2016-12-5
Then select the answer, which solves your problem or post an own answer for selecting, such that the forum can see, that the problem ist solved. Thanks.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Time Series Objects 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!