Using Matlab to Organize Excel Data into Separate Columns
2 views (last 30 days)
Show older comments
Mariah Titsworth
on 18 Nov 2019
Commented: Mariah Titsworth
on 18 Nov 2019
I am trying to create a script to separate data that is currently all in one column into three seperate columns. This column contains X, Y, and Z coordinates for a particular objects, seen in Figure 1. I need to create a script inorder to arrange the data to the format in Figure 2. I am having difficulties trying to figure out how to start the code, how to move the values, and how to delete the two additional object names once the data is moved. The data will then need to be exported into an Access Database. Can anyone please help me?
Figure 1
Figure 2
0 Comments
Accepted Answer
Guillaume
on 18 Nov 2019
demodata = table(repelem({'Object1'; 'Object2'}, 3), repmat({'X'; 'Y'; 'Z'}, 2, 1), rand(6, 1)*6000-3000, ...
'VariableNames', {'Name', 'Control', 'Meas'})
unstack(demodata, 'Meas', 'Control')
More Answers (0)
See Also
Categories
Find more on Spreadsheets in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!