How can I import a specific cell from a .csv file with mixed text and numeric values? I want to import the text values. Thanks!
1 次查看(过去 30 天)
显示 更早的评论
Hello, I have a .csv and another .dat files with multiple data within them, numeric and text values. I was able to extract all the numeric data that I needed from each by using the csvread function and later using a concatenation. Now I want to extract specific data (from these same files) that is in (for instance) the cell 0,0 (cell A1 in the .csv file) and another that is in the cell C2 (or row 1 cell 2) in the .dat file. One is numerical and the other is text. So how can I export it to a variable that I want to use later in my code?
Thanks in advance.
2 个评论
dpb
2016-12-16
编辑:dpb
2016-12-16
If you're asking to mix these two datatypes into a single variable, that variable will have to be a cell array to hold the two types or you'll have to convert the numeric to string to be able to smush the two together...
Showing a (small) example of the files and the data and the expected result would certainly help...
ADDENDUM Got interrupted; lost train o' thought...intended to add if these are disparate data types but related, look at using the table providing you're at R2013b or later.
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Data Import and Export 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!