Filter löschen
Filter löschen

Error using writetable function in Matlab R2017a

13 Ansichten (letzte 30 Tage)
Louise Giansante
Louise Giansante am 6 Jun. 2017
Beantwortet: alexandre iolov am 27 Okt. 2017
Hello,
I've just started working with a trial version of Matlab R2017a. I've been using the same code I worked with in the latest version, Matlab R2015a, but it is not working in R2017a. I need to save an excel file in the end of the code, but it appears to happen several different errors every time I run it. As part of the code I added a function that is only available in Matlab R2017 and therefore I cannot work with the older version anymore. Can somebody, please, help me? Have you seen something similar?
One of the errors, for instance:
"The range must be a character vector of the form 'A1:B2' or 'A1'."
But if you check my code:
filename = 'planilha.xlsx';
writetable(T,filename,'Sheet',1,'Range','A1')
I defined a range.
Another random error if I run the program again:
Disable sheet protection, disable workbook's Mark as Final option, and ensure input does not exceed cell capacity.
As you can see it is not only one error, but it is completely random.
I'll be glad if someone can help me.
  3 Kommentare
Louise Giansante
Louise Giansante am 13 Jun. 2017
Thank you for your comment; however, this error seems to be completely random. If I run my routine again, another error occurs. Also, when I used 2015a version, it didn't happen.
Walter Roberson
Walter Roberson am 13 Jun. 2017
Is there a different process also running that is accessing the file?

Melden Sie sich an, um zu kommentieren.

Antworten (1)

alexandre iolov
alexandre iolov am 27 Okt. 2017
I just received this error out-of-the-blue, when writing a 9x9 table to a perfectly non-existing .xlsx (or .xls) file. It turns out that the cause is that i have very large dates (sentinels for infinity) e.g. this will blow up
dt = utcdatetime(9999, 12, 31, 23,59,60)
T = array2table(dt)
writetable(T, 'BigDate.xls')
This will not
dt = utcdatetime(9999, 12, 31, 23,59,59)
T = array2table(dt)
writetable(T, 'BigDate.xls')

Kategorien

Mehr zu Data Import from MATLAB finden Sie in Help Center und File Exchange

Produkte

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by