Inserting rows (location specified by ID)
Mostra commenti meno recenti
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 Commento
Sean de Wolski
il 22 Mar 2011
Can you provide a small example (inputs/operations/expected outputs) please. It'll make it much easier for us to tackle your problem.
Risposte (1)
Jos (10584)
il 22 Mar 2011
0 voti
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:
Categorie
Scopri di più su App Building in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!