Export Data to Excel Error:
3 views (last 30 days)
I have three different output arrays as low voltage, med voltage and high voltage. Three arrays have different number of rows. I want to export three arrays as three different columns of same excel sheet.I tried to use the writetable, but after one writetable command, it is giving error
"Unable to write to file 'FlowDistinction_Yearly.xlsx'. You may not have write permissions or the file may be open by another
filename = 'FlowDistinction_Yearly.xlsx'
I checked few other options but most of them require same number of rows but in my case, number of rows will be different for each column.
Clayton Coonrod on 30 Jun 2022
A = [1,2,3,4];
B = [5,6,7];
C = [8,9,10,11,12];
More Answers (2)
Cris LaPierre on 30 Jun 2022
Edited: Cris LaPierre on 30 Jun 2022
I am able to reproduce the error in R2018b. This appears to be an issue that has been fixed in newer versions of MATLAB. Any chance you can update your MATLAB version?
Note that, to write your data , I think you want the following Range syntax
Image Analyst on 30 Jun 2022
Maybe the workbook is still locked because the first call to writetable() has not finished 100%. If you put
pause(2); % Wait 2 seconds for writetable to finish.
in between the calls to writetable, does it work then?