Using Matlab to Organize Excel Data into Separate Columns

2 ビュー (過去 30 日間)
Mariah Titsworth
Mariah Titsworth 2019 年 11 月 18 日
コメント済み: Mariah Titsworth 2019 年 11 月 18 日
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
Current Sheet.PNG
Figure 2
Format Needed.PNG

採用された回答

Guillaume
Guillaume 2019 年 11 月 18 日
It's trivial to do with unstack:
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')

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeSpreadsheets についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by