Info
此问题已关闭。 请重新打开它进行编辑或回答。
How can i break down the values of vector into group of five?
1 次查看(过去 30 天)
显示 更早的评论
Here, i want to read first 5 values of the vector and after that i want to read next 5 values of same vector continously.
0.6137
0.8946
1.1238
1.5200
2.9336
9.9637
10.3845
10.5308
10.8468
12.0193
16.5591
16.9117
17.0800
17.6835
19.9467
24.6567
24.9646
25.1283
25.5325
26.3262
29.9249
30.1739
30.3119
30.6054
31.4281
34.2383
34.5242
34.6736
35.6291
36.3185
39.1514
39.4394
39.5863
39.9892
40.6942
45.1461
45.3931
45.6263
45.9219
46.6433
49.6028
49.8943
50.0356
50.5986
51.3305
54.3656
54.6409
54.7636
55.0352
57.0281
0 个评论
回答(1 个)
Fabio Freschi
2019-10-29
If x is your vector you can reshape it
y = reshape(x,5,numel(x)/5);
and access each column with indexing
% column 10
iCol = 10;
y(:,iCol)
2 个评论
Fabio Freschi
2019-10-30
this is not a good programming choice. Look the discussion here:
There are bunch of alternatives, the access to the variable columns is one of these.
此问题已关闭。
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!