How can I round numbers from a column?

16 Ansichten (letzte 30 Tage)
Cristian Martin
Cristian Martin am 14 Jun. 2020
Kommentiert: Cristian Martin am 14 Jun. 2020
Hi,
I have:
load('work.mat');
C = T(:,2);%read second column
C{:, 1} = regexprep(C{:, 1}, '[(ms)]', '');%eliminate text after numbers
X = round(C)
How do I round the numbers after I delete the text ?
____________________________________________________
Undefined function 'round' for input arguments of type 'table'.
Error in Runscript (line 8)
X = round(C)

Akzeptierte Antwort

madhan ravi
madhan ravi am 14 Jun. 2020
Bearbeitet: madhan ravi am 14 Jun. 2020
round(C{:,1})
  10 Kommentare
madhan ravi
madhan ravi am 14 Jun. 2020
doc str2double
Cristian Martin
Cristian Martin am 14 Jun. 2020
Thank You Ravi !

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Environment and Settings finden Sie in Help Center und File Exchange

Produkte


Version

R2016a

Community Treasure Hunt

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

Start Hunting!

Translated by