Effacer les filtres
Effacer les filtres

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

2 vues (au cours des 30 derniers jours)
Jingyu Yang
Jingyu Yang le 22 Août 2020
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?

Réponses (1)

Steven Lord
Steven Lord le 22 Août 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.)

Catégories

En savoir plus sur Tables dans Help Center et File Exchange

Tags

Produits


Version

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by