Borrar filtros
Borrar filtros

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

2 visualizaciones (últimos 30 días)
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?

Respuestas (1)

Steven Lord
Steven Lord el 22 de Ag. de 2020
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.)

Categorías

Más información sobre Tables en Help Center y File Exchange.

Etiquetas

Productos


Versión

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by