Why does the pound sign (UK currency) not appear correctly when using "writetable"?

7 views (last 30 days)
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
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')

More Answers (0)

Products


Release

R2020b

Community Treasure Hunt

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

Start Hunting!