|
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
|