How to properly import a dataset including characters and numbers?

12 次查看(过去 30 天)
Hello all, I am in the process of importing an xls based data input file. The data has several columns- some of them include an exponential digit, expressed with an "e". A sample of the dataset is shown below:
.49 .159 5.16e-04 7.42e+02 .155
.. etc
I tend to use the "import data" function, and automatically had it generate a script. However, upon seeing the e and + characters, matlab imports that column to be a cell via the cellvectors() command.
As a result I have a combination of data() files and cellvectors() files- with these data types, I unfortunately cannot plot all of the data output together.
Can anybody help me in a way to enable the data importing so it can properly handle exponential files? (Or if there is no other way, is there a way to "convert" the cell file with the characters as a float number that can be plotted with the other number values?)
Thanks in advance for the help.

采纳的回答

Samuel
Samuel 2017-2-2
编辑:Samuel 2017-2-2
I was able to find the solution- in the import data option, I can click on the column selection and click on the data type it needs to be imported to- for the ones that says "cell", I can make it be a number, and clicking on "apply to selection" applies to every part that needs to be changed.
I am not sure if I am allowed to "accept" my own answer, but Just an fyi to the future people that might be interested. feel free to leave a comment if anybody needs more help.

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Large Files and Big Data 的更多信息

产品

Community Treasure Hunt

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

Start Hunting!

Translated by