Reputation: 23
Z= magic(4)
Z =
16 2 3 13
5 11 10 8
9 7 6 12
4 14 15 1
>> W= sign(Z)== -1
W =
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
>> xlswrite('sample.xlsx',W)
Error using xlswrite (line 220) Invoke Error, Dispatch Exception: Source: Microsoft Office Excel Description: Microsoft Office Excel cannot access the file 'C:\Program Files\MATLAB\R2012a\bin\644A5000'. There are several possible reasons:
• The file name or path does not exist. • The file is being used by another program. • The workbook you are trying to save has the same name as a currently open workbook. Help File: C:\Program Files\Microsoft Office\Office12\1033\XLMAIN11.CHM Help Context ID: 0
i have created a excel file ('sample.xlsx') on desktop . how to use xlswrite function. how to save mat file generated by sign function in excel sheet .
Upvotes: 0
Views: 2194
Reputation: 11228
I just got the same error.
Answer is here: 'C:\Program Files\MATLAB\R2012a\bin\644A5000'
Your MATLAB workspace now is located at this way - you can see it in address toolbar in MATLAB (under main menu)
So i have no administration privileges so I can't create any files in folder Matlab uses by default and got this error.
You need to create folder in where you can create and edit anything (you already did it on the Desktop really) CHANGE this path in MATLAB to it's directory (C:Users\yourname\Desktop) and then only use xlswrite
.
One more thing - you really need no to create .xlsx file before using xlswrite - if file is not exist it will creates automatically:
If filename does not exist, xlswrite creates a file, determining the format based on the specified extension.
Hope it helps!
Upvotes: 0