问题
while I run the following code, an example in matlab:
filename = 'testdata.xlsx';
A = [12.7 5.02 -98 63.9 0 -.2 56];
xlswrite(filename,A)
I get the error
Error using xlswrite (line 219)
I have already tried to slove this problem. I reinstall office, and reinstall matlab, but i doesn't work. However, the above code is valid in other PC.
回答1:
Try using csvwrite instead of xlswrite. Both can be read by excel, but csvwrite will be less buggy to office installations. If csvwrite works, then you can look further into office compatability issues.
回答2:
Just open the Windows Task Manager (Ctrl+Shift+Esc), then click on "More details", in "Processes" find and close all excel processes and then run your code.
来源:https://stackoverflow.com/questions/35699929/error-using-xlswrite-line-219-in-matlab