Numeric data becomes zero after conversion from Table
이전 댓글 표시
I am trying to extract data collected via IMU using the readtable function like this:
%Extracting data from the LGW folder
[filename, pathname] = uigetfile('*.dat');
T1 = readtable(strcat(pathname,filename),"ReadVariableNames",true);
T1 = T1(:,1:end-2);
[filename, pathname] = uigetfile('*.dat');
T2 = readtable(strcat(pathname,filename));
T2 = T2(:,1:end-2);
[filename, pathname] = uigetfile('*.dat');
T3 = readtable(strcat(pathname,filename));
T3 = T3(:,1:end-2);
[filename, pathname] = uigetfile('*.dat');
T4 = readtable(strcat(pathname,filename));
T4 = T4(:,1:end-2);
T4(:,[51 52]) = [];
[filename, pathname] = uigetfile('*.dat');
T5 = readtable(strcat(pathname,filename));
T5 = T5(:,1:end-2);
T5(:,[51 52]) = [];
[filename, pathname] = uigetfile('*.dat');
T6 = readtable(strcat(pathname,filename));
T6 = T6(:,1:end-2);
T6(:,[51 52]) = []
However, when converting it to numeric data like this:
nums = [LGW_Pelvis{2,:}]
The data becomes zero except for the all the row under the first column.
I have tried changing the format into cell and timetable but when getting the numeric data format from these data types: they becomes zero.
댓글 수: 8
Walter Roberson
2023년 1월 26일
please show us
unique(varfun(@class, LGW_Pelvis, 'OuputFormat', 'cell'))
Rainer Rodrigues
2023년 1월 26일
Stephen23
2023년 1월 26일
unique(varfun(@class, LGW_Pelvis, 'OutputFormat', 'cell'))
% ^ fix spelling mistake
Rainer Rodrigues
2023년 1월 26일
Walter Roberson
2023년 1월 26일
You show us code for constructing several table objects, and then you show us a variable name that does not match any of the table objects without showing us how you constructed the variable.
Rainer Rodrigues
2023년 1월 26일
Walter Roberson
2023년 1월 26일
Okay, please show us
unique(varfun(@class, data_LGW(1,61:70), 'OutputFormat', 'cell'))
Rainer Rodrigues
2023년 1월 26일
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Tables에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!