Error Message "'This package uses the Matlab command xlsread to read from Excel files...." Matlab 6/Matlab 7
Show older comments
Dear all,
when I'm running the file DSGEFig1.m a window pops up, asking for "Specify Excel: Enter the name of the Excel input file". Now the problem is that when I enter the excel file and click OK, I get the following error message:
'This package uses the Matlab command xlsread to read from Excel files.',...
'This command appeared for the first time in Matlab 6. Your version of Matlab is older than version 6.',...
'You must modify the file DSGEReadExcel to read in data etc in some other way. Or upgrade Matlab ...'
I use the Matlab version 2023b.
which -all xlsread
and check for third party toolboxes and support packages. However, when I enter this code line, I get
/Applications/MATLAB_R2023b.app/toolbox/matlab/iofun/xlsread.m
As I see it, third party toolboxes and support packages are not the problem in my case.
I tried to change the code in DSGEReadExcel from xlsread to readtable and readmatrix but I still get the same error message.
Can someone help me and tell me, how I can solve the problem?
Many thanks for your help!
4 Comments
dpb
on 5 Jul 2024
They are the problem if they think R2023b is older than version 6; the logic in the code that is testing the version is apparently flawed...
Torsten
on 5 Jul 2024
I'd comment out the commands used for a version check in the package you are using.
dpb
on 5 Jul 2024
I had just come back to add @Torsten's suggestion to my earlier response -- just don't try to test for the release at all and xlsread (while having gone through an entire life cycle by now being deprecated rather than predating the release) should work just fine presuming the spreadsheet input form is within the expectations of the package. This must be a very old piece of work, but that alone doesn't mean it isn't good; there's FORTRAN code from the 50s and 60s still in active use...
Andreas Goser
on 5 Jul 2024
As there are holidays in the US, you may want to wait a bit if other attempts to help come in next week. Here my 2 €cts:
Your path suggests your installation is not on Windows. Let me guess it is Linux. If I recall it correctly, historically XLSREAD needed an installation of Microsoft Excel and there was an AxtiveX communication to read the data. As there was no Microsoft products on Mac and Linux during those days (not entirely sure how it is today), this was a limitation of using code across platforms which was one of probably mutlple reasons to find a different approach.
With that in mind, I wonder what your overall workflow is. The Excel files come from somewhere. Like you or a project partner measure someting and store it in Excel format and then you are tasked to do post-processing. Could this be changed easily so it is stored in a different format? Or even use the Data Acquistion Tbx to make the measurements in it is in MATLAB right away?
Accepted Answer
More Answers (0)
Categories
Find more on Data Import from MATLAB in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!