Azzera filtri
Azzera filtri

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 visualizzazione (ultimi 30 giorni)
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 Commenti
dpb
dpb il 16 Dic 2016
Modificato: dpb il 16 Dic 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.

Accedi per commentare.

Risposte (0)

Categorie

Scopri di più su Data Import and Export in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by