×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Import Data from excel sheet

Import Data from excel sheet

Import Data from excel sheet

(OP)
I have a .xls sheet which consists of strings and numerics. I want to load it into a matrix in order to do further calculations etc. The xlsread function in matlab works only if the strings are placed in the header. In my case however it does not work since the strings are placed in several columns. Please help.

Thanks

 

RE: Import Data from excel sheet

clear as mud.  show example/demo of your sheet or better description of what is in the numeric and text arrays from xlsread.  Sometimes you can format an extra sheet in the workbook which is actually characters (text) but looks like numbers.  Then all characters will be in one text array.  Just convert to nums.  

RE: Import Data from excel sheet

(OP)
cibachrome,
I have attached a sample file to show the kind of data I have in it. I want to import this data into a matrix in matlab. Once imported into a matrix say A, I would like to access the elements of this matrix irrespective of it being a number or a string. I hope that is clearer now. Thanks

RE: Import Data from excel sheet

[num,txt,A]=xlsread('c:\temp\book1.xls');
A(:,size(num,2)+1:end)=[];  % You have some extra crap in there. Delete it.

A{2,2}    % Use curly braces for addressing cell contents
A{end,end} % make sure we got it.

isnumeric(A{1,1})   % checks before dealing with contents
ischar(A{4,2})

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members! Already a Member? Login



News


Close Box

Join Eng-Tips® Today!

Join your peers on the Internet's largest technical engineering professional community.
It's easy to join and it's free.

Here's Why Members Love Eng-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close