Convert CSV to cell array
58 views (last 30 days)
Show older comments
I've tried searching for solutions to this, but can't seem to find one that works for my file format. I have a .CSV file output from some other software, and want to analyse the data in Matlab. The output (attached 2 examples) consists of a row of amplitudes, a row of standard deviations (the length of which varies by data set), and then a row of fit diagnostics. Following that is a table with additional information.
Is there a way to directly convert this CSV into a cell array? I'm sure I could write something to stucture the data once it's in a cell array, but using things like textscan etc has been giving me a headache...
0 Comments
Answers (1)
Gaurav Ahuja
on 5 Jan 2018
use this syntax
if true
[num,txt,raw] = xlsread(___)
end
returns the text fields in cell array txt, and both numeric and text data in cell array raw, using any of the input arguments in the previous syntaxes.
refer this documentation link for example: https://in.mathworks.com/help/matlab/ref/xlsread.html#bthgbmn
Hope this helps.
0 Comments
See Also
Categories
Find more on Data Type Conversion in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!