How to divide a row vector to 6 small row vector with faster technique?
1 回表示 (過去 30 日間)
古いコメントを表示
Hello, dose anyone can give me an advice of the problem below? Thanks!
problem: I got a 1-by-366 row vector now. However, I need to divide it to get the six small row vector which size of everyone is 1-by-61 and then use plot() to illustrate the plot like plot(x,c(1),x,c(2),x,c(3),x,c(4),x,c(5),x,c(6))
I can assign every one slowly like c(1) = b(1:61),c(2) = b(62:122)... but I also want to know the faster technique maybe like for loop or other method and I can apply it when I encounter some case need to divide more small row vector. Thanks!
0 件のコメント
採用された回答
KSSV
2017 年 8 月 26 日
doc reshape. This would be faster....
A=rand(1,366);
B=reshape(A,6,[]);
5 件のコメント
John D'Errico
2017 年 8 月 26 日
What happens if you call plot like this:
plot(1:61,cumsum(rand(61,6)))
What does this do? TRY IT. And READ THE HELP FOR PLOT!
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Resizing and Reshaping Matrices についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!