Inserting rows (location specified by ID)

Hi there. I'm very novice when it comes to code writing and need help. I'll try to simplify the problem. I have a large dataset with columns (A:E)and rows (1:1000). The rows 'belong' to approx 600 IDs (column A). I need to move column B 'into' column E so that: - a new row (or rows) is inserted under each ID (some ID have multiple rows) - data in column B for each ID is copied to the new row under column E. - data in the other columns for each ID are copied to the new row(s)
Is this doable in MATLAB? I'm using R2008B. Thank you for your help.

1 个评论

Can you provide a small example (inputs/operations/expected outputs) please. It'll make it much easier for us to tackle your problem.

请先登录,再进行评论。

回答(1 个)

Jos (10584)
Jos (10584) 2011-3-22
Take a look at insertrows that ... well ... insert rows at locations specified by row indices.
The problem than becomes how to get row indices from your ID's. That could be trivial, but, as Sean de already pointed out,provide us with a small (small!) example of input, operations and expected output, so that repliers can be of more help.
Anyhow, here is the link to insertrows on the Fex:

类别

帮助中心File Exchange 中查找有关 App Building 的更多信息

提问:

2011-3-22

Community Treasure Hunt

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

Start Hunting!

Translated by