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!