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!