Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

How do I force the dataimport function to always work in basic mode?

Asked by Gregory on 2 Apr 2013

I'm importing an xls file via importdata on my local machine which has Microsoft Excel installed. The returned structure has Excel dates under text.

It looks something like this:

returnedData.data.wksht = [nxm];
returnedData.text.wksht = {cell of date strings};

I'm deploying this script to a machine that does not have MS Excel installed. The importdata function interprets the dates in the file as numbers and therefore places them under data in the returned structure.

This scenario looks something like this:

returnedData.data.wksht = [nx(m+1)];
returnedData.text.wksht = empty;

The subsequent code breaks since the data is moved around. Is there a way to control this? Is there a way to force dataimport to operate in Basic mode on my local machine? I can't find any options to do this.

Thanks!

0 Comments

Gregory

Products

No products are associated with this question.

1 Answer

Answer by Walter Roberson on 2 Apr 2013

You can call xlsread() directly with the 'basic' flag.

0 Comments

Walter Roberson

Contact us