Copying values between two index number

2 次查看(过去 30 天)
651 1338 1997 2679 3394 4222 4879 5619 6313 7047 7624 8408
1 1 1 1 1 1 1 1 1 1 1 1
0 1,34 1,28 1,33 1,39 1,61 1,28 1,44 1,35 1,43 1,12 1,53
Hi Everyone,
I have the above table, which in the first row the location is represented and in the third some kind of time interval. Now I want to copy the values of the third row between 1:2500, 2500:5000 and so on of the first row. How can I do this?
Thank you!
  1 个评论
Image Analyst
Image Analyst 2019-1-17
This does not make sense: "Now I want to copy the values of the third row between 1:2500, 2500:5000 and so on of the first row."
Are you copying values of "the third row", OR of "the first row"? Or both?
What, exactly is being copied? And where is it copied TO? A new variable? Vectors? A matrix?

请先登录,再进行评论。

回答(2 个)

madhan ravi
madhan ravi 2019-1-17

Andrei Bobrov
Andrei Bobrov 2019-1-17
P = [651 1338 1997 2679 3394 4222 4879 5619 6313 7047 7624 8408
1 1 1 1 1 1 1 1 1 1 1 1
0 1.34 1.28 1.33 1.39 1.61 1.28 1.44 1.35 1.43 1.12 1.53];
out = accumarray(ceil(P(1,:)'/2500),P(end,:)',[],@(x){x});

类别

Help CenterFile Exchange 中查找有关 Tables 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by