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 CenterFile Exchange에서 Spreadsheets에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by