Thread Subject:
xlsread in Matlab Executable

Subject: xlsread in Matlab Executable

From: Alaa Elwany

Date: 17 Jan, 2012 02:25:08

Message: 1 of 1

Hi,

I have an M File that starts with importing some data from Excel, as follows:

a = xlsread('Myfile.xlsx');

I write the file without the path, then just make sure that the Excel file is placed within Matlab's working directory.

Now, I am creating a stand alone executable from this M File. This .exe will be run on a computer that doesn't even have Matlab installed on it, so there is no "working directory" to set!
How do I make sure that the data is read from the file Myfile.xlsx placed in the same folder where the executable is? If I keep it to:

a = xlsread('Myfile.xlsx');

Sometimes it runs well, sometimes it gives an error "xlsread cannot open Myfile.xlsx". Apparently, it doesn't necessary go and look for Myfile.xlsx in the same folder of the executable.

Any input? Is there some (generic path) that I can put to ensure xlsread will search for the file in the same folder where the executable is saved?

Thanks alot,

Alaa

Tags for this Thread

Everyone's Tags:

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.

Tag Activity for This Thread
Tag Applied By Date/Time
xlsread Alaa Elwany 16 Jan, 2012 21:29:12
executable Alaa Elwany 16 Jan, 2012 21:29:12
working directory Alaa Elwany 16 Jan, 2012 21:29:12
rssFeed for this Thread

Contact us