Skip to Main Content Skip to Search
Login
File Exchange
MATLAB Newsgroup
Link Exchange
  Blogs  
 Contest 
MathWorks.com

Thread Subject: dlmread problem

Subject: dlmread problem

From: Ender

Date: 3 Jul, 2008 14:24:01

Message: 1 of 2

I am trying to read a file from Excel that has both text
and data values. The first three columns all have text in
them. I want to read the data from the first two columns,
but begin after the text in row 1. I have tried using
dlmread and telling MATLAB to skip the first row, but I
get this error:

??? Error using ==> textscan
Mismatch between file and format string.
Trouble reading number from file (row 1, field 1) ==>

This is the code that I used:

PIT_MKV_2 = dlmread('IndvsPP.xls','',[1,0,2,0]);

I also tried using this line of code to read the data, but
I get the same error. This is the code that I used:

PIT_MKV_2 = dlmread('Thisdata vs.
Thatdata.xls','','A2..B3');

I put a grey box in Column 3 of the Excel file to divide
the data, but I don't think that should make a difference.

--Ender--

Subject: dlmread problem

From: Titus

Date: 4 Jul, 2008 11:12:38

Message: 2 of 2


"Ender " <jr147@msstate.edu> schrieb im Newsbeitrag
news:g4ine1$339$1@fred.mathworks.com...
>I am trying to read a file from Excel that has both text
> and data values. The first three columns all have text in
> them. I want to read the data from the first two columns,
> but begin after the text in row 1. I have tried using
> dlmread and telling MATLAB to skip the first row, but I
> get this error:
>
> ??? Error using ==> textscan
> Mismatch between file and format string.
> Trouble reading number from file (row 1, field 1) ==>
>
> This is the code that I used:
>
> PIT_MKV_2 = dlmread('IndvsPP.xls','',[1,0,2,0]);
>
> I also tried using this line of code to read the data, but
> I get the same error. This is the code that I used:
>
> PIT_MKV_2 = dlmread('Thisdata vs.
> Thatdata.xls','','A2..B3');
>
> I put a grey box in Column 3 of the Excel file to divide
> the data, but I don't think that should make a difference.
>
> --Ender--

Hi Ender,
dlmread reads ascii files. Use xlsread to read Excel files...

Titus


Tags for this Thread

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

rssFeed for this Thread

envelope graphic E-mail this page to a colleague

Public Submission Policy
NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Disclaimer prior to use.
Related Topics