How can I round numbers from a column?

18 vues (au cours des 30 derniers jours)
Cristian Martin
Cristian Martin le 14 Juin 2020
Commenté : Cristian Martin le 14 Juin 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)

Réponse acceptée

madhan ravi
madhan ravi le 14 Juin 2020
Modifié(e) : madhan ravi le 14 Juin 2020
round(C{:,1})
  10 commentaires
madhan ravi
madhan ravi le 14 Juin 2020
doc str2double
Cristian Martin
Cristian Martin le 14 Juin 2020
Thank You Ravi !

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur MATLAB dans Help Center et File Exchange

Produits


Version

R2016a

Community Treasure Hunt

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

Start Hunting!

Translated by