Prev: Stateflow exit condition priority between parent and child state exit condition
Next: how to save the file with date and time(clock) automatically
From: Jay on 22 Oct 2009 04:14 I'm new to Matlab and generally to running something without a GUI, and am trying to import data from an excel spreadsheet just using the Import Wizard. I run Matlab on Leopard on a Macbook, and am using a Windows version of Excel run on my VMWare Fusion PC on the same computer. I would like to import the spreadsheet with the column headers as vectors, but the option "Create vectors for each column using column names" is grayed out (as is the option for rows). The same happens when I save my excel spreadsheet as a text file. Just because of inertia, I would like to be able to continue to enter data into Excel before I import it into Matlab, so it would be really helpful if I could import columns as vectors. My only option at present is to import the textdata and data as variables, which seems like an unnecessary decoupling for what I'm doing, because some of the data is text. Why are the options I need grayed out?
From: Jay on 22 Oct 2009 07:27
working around this. Used : [ndata, headertext] = xlsread('filename.xls') Am parsing the column and row headers using for loops: Example for rows: for n = 2:57 newvector{n} = headertext {n, 1} end end In the end, I have a matrix with numerical data and two vectors representing the column headings and row names. I haven't figured out how to deal with non-numerical data yet. |