Filter löschen
Filter löschen

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 Ansicht (letzte 30 Tage)
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 Kommentare
dpb
dpb am 16 Dez. 2016
Bearbeitet: dpb am 16 Dez. 2016
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.

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Kategorien

Mehr zu Data Import and Export finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by