Is there a way to convert table columns and terms into regular numbers?

2 次查看(过去 30 天)
I made Table set from excel file.
Timeline = readtable('Timeline.xlsx');
Lidar_DeltaT = Timeline(2, 6);
Lidar_Distance= readtimetable('Lidar Cycle.txt');
summary(Lidar_Distance);
Lidar_Distance.Time = Lidar_Distance.Time + seconds(Lidar_DeltaT);
Timeline(2, 6)'s number value is 1
I want to make
"Lidar_Distance.Time = Lidar_Distance.Time + seconds(Lidar_DeltaT);"
line has same meaning of the line
"Lidar_Distance.Time = Lidar_Distance.Time + seconds(1);"
But It occurs an error. What should I do?

回答(1 个)

Steven Lord
Steven Lord 2020-8-22
You haven't showed us the text of the error, but I'm guessing it was:
Error using seconds (line 19)
Input data must be a real, numeric array.
Using parentheses to index into a table array (like Timeline) returns a smaller table.
Using curly braces to index into a table array returns the contents of those elements of the table.
Using dot to retrieve a variable from a table array returns the contents of that variable.
t = table(123)
s1 = seconds(t(1, 1)) % Throws an error
s2 = seconds(t{1, 1}) % Works
s3 = seconds(t.Var1) % Also works
If that's not the text of the error, please show the full and exact text of the error (all the text displayed in red in the Command Window.)

类别

Help CenterFile Exchange 中查找有关 Tables 的更多信息

标签

产品


版本

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by