Why does the pound sign (UK currency) not appear correctly when using "writetable"?
7 views (last 30 days)
Show older comments
MathWorks Support Team
on 27 Jan 2023
Answered: MathWorks Support Team
on 27 Jan 2023
When trying to use the "writetable" function to save a table in MATLAB to a .csv file, the pound sign (£), appears as (£) in Microsoft Excel. However, when viewing it in MATLAB, it appears normally, without the extra Â. How can a table with £ be saved correctly?
Accepted Answer
MathWorks Support Team
on 27 Jan 2023
This is likely due to a difference in encoding. The default encoding for MATLAB is UTF-8, however for Excel it is likely different. You can change the encoding as an option during the "writetable" call. For example:
>> writetable(T,'myData.csv','Delimiter',',','QuoteStrings',true, 'Encoding', 'ISO-8859-1')
0 Comments
More Answers (0)
See Also
Categories
Find more on Spreadsheets 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!