Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

From Excel to Matlab

Status
Not open for further replies.

ysg519

Mechanical
Sep 1, 2007
17
0
0
US
I have a two dimensional array in excel such that each cell has a different number of elements separated by commas. For example

Cell A1 has 1.5,201,202,400
Cell B1 has 1.5,202,3000,400,170,190,5.6

Is there an effecient way or command which will bring this data into matlab in the form of cell arrays consisting of either numbers of strings.

I tried using [A,data4] = xlsread('filename') but that does seem to work for two dimensional array in this situation.

Please let me know if this question is 'clear as mud' and I will try to re-explain. Thanks
 
Replies continue below

Recommended for you

Works for me. data4 becomes a cell array with 2 elements: contents of A1 and contents of B1.

To get numbers from this, use str2num(data4{1}) and str2num(data4{2})

Those are curley braces around the 1 and 2.

 
Status
Not open for further replies.
Back
Top