How to take out units in a column

1 次查看(过去 30 天)
I am trying to do a 3D plot where I would plot the x and y coordinates over time, but when I try to use the plot3 command, it says all of the data needs to be numeric values.
Therefore, I am trying to take out the 'sec' shown in the first column when I import my data, but am having no luck.
I tried using
>> sscanf(data, '%f')
Error Message: First argument must be a string scalar or character vector.
I tried
>> num2str(data)
Error Message: Input to num2str must be numeric.
and I tried a few other ones which I realize wasn't even going to do what I expect it to do.
  3 个评论
Ameer Hamza
Ameer Hamza 2020-4-17
The column 1 have class of 'duration'. See my answer to convert them to double datatype.

请先登录,再进行评论。

采纳的回答

Ameer Hamza
Ameer Hamza 2020-4-17
out.time = seconds(out.time);

更多回答(0 个)

类别

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

标签

Community Treasure Hunt

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

Start Hunting!

Translated by