Borrar filtros
Borrar filtros

Creating a spreadsheet with experiment data from matlab?

3 visualizaciones (últimos 30 días)
Karl
Karl el 14 de Mayo de 2013
Hello all,
I'm trying to use matlab to automate some data prep that I do after an experiment. This largely consist of grabbing data out of individual csv files into a single large csv file with column names above each data set.
The names are the tricky part for me as I'm getting forgetful but matlab does not like when you try to shove a string into a matrix. Thus at the moment I an just putting a number at the top of each column and then manually going and renaming each column later which sorta defeats the purpose to some extent.
Any suggestions on what I should be doing? Combining the matrix into a cell array or something of the sort?
****Example code****
%Reading in data
for j=1:size(filelist,1)
spectrumtotal(1,j) = j; %title each column
% what to use something like 'filelist(j,1:5)' instead
spectrumtotal(2:end,j) = csvread(strtrim(filelist(j,1:end)),0,1);
%copy data from individual files into master matrix
end
%filelist is a list of the files in the folder gotten using the ls command.
%spectrumtotal is a matrix sized to fit the column headers and data.
****End code****
Thank you for your time and consideration!

Respuestas (0)

Categorías

Más información sobre Characters and Strings en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by