How to paste nicely into Excel from MATLAB variable editor?
Show older comments
One can readily paste data from Excel into a MATLAB cell array in the variable editor using Paste Excel Data (Ctrl-Shift-V), but how exactly does one reverse this operation?
I find cells that contain [] become strings in Excel, where I expect blank cells, and strings get unwanted quotes at the start and end.
The net result of this is if you copy and paste some cells in Excel comprising some text, some numeric and some blanks into a MATLAB cell array - it looks fine in MATLAB - but when you copy back to Excel you don't have what you started out with.
Easy copy / paste between Excel and MATLAB should be a breeze in 2015, shouldn't it? What am I doing wrong? Perhaps there is or needs to be a "Copy Excel Data" function to match "Paste Excel Data" (although it is nicer to just use standard Ctrl+C, Ctrl+V)?
Thanks for reading this.
Accepted Answer
More Answers (9)
P D McClanahan
on 16 Nov 2017
6 votes
One easy workaround is to: 1) Paste into Google sheets, which seems to work fine 2) Then copy from Google sheets into Excel
1 Comment
Javier
on 13 Oct 2022
Thanks!
Lex
on 8 May 2021
2 votes
This answer is very late given when the question was asked, but I found success just directly copy and pasting (Ctrl+C and Ctrl+V) , then going to "Data" and selecting "Text to Columns" and then following the instructions.
You would have to play with it to figure out what works for you, but there are instructions online how to use "Text to Columns."
1 Comment
Sourabh Biswas
on 2 Jul 2021
Thanks Lex. This works fine for me.
Jg
on 21 Jan 2016
1 vote
Julian,
I'm no Matlab guru so I like simple solutions like you're looking for.
I've had luck with Ctrl+C to copy from the variable editor, then paste into Microsoft Word. Then copy and paste from word to Excel.
May work for you too.
Zhe
on 5 Jul 2017
1 vote
Copy and paste to Google Sheets then to Excel
Daniel
on 25 Feb 2015
0 votes
I don't know much about converting back Excel, but you might want to look into xlswrite. That command may do the trick for you.
2 Comments
Julian
on 25 Feb 2015
Will Reeves
on 27 Sep 2023
clearly not... And still an issue in 2023
Sascha Schlechtweg
on 15 May 2017
0 votes
Using Ctrl+C and Ctrl + V in OpenOffice worked perfectly fine for me. Maybe it helps.
Best regards
Julian
on 15 May 2017
0 votes
Joel Bay
on 4 Mar 2020
None of these other methods seem to work anymore, but what you can do is:
writetable(cell2table(myCellArray));
And then you'll have a nicely copy and pasteable table in your work directory.
Rafid Bendimerad
on 31 Mar 2020
Edited: Rafid Bendimerad
on 31 Mar 2020
0 votes
Here are the steps:
1- Copy your array from Matlab.
2- Paste your array in Excel.
3- Select your array in Excel.
4- type: Ctrl + F (Press the button Ctrl and the button F simultaneously).
5- A window will appear (Find - Replace). Choose Replace.
6- Then,
Find what: .
Replace with: ,
(Look to the picture below)
It's Done.
Basically, we just replace the period (.) by a coma (,). And this is bacause Matlab uses "periods" while Excel uses "comas". For example: Matlab writes: 5.5 while Excel writes 5,5.
Got it ?
Good Luck.

1 Comment
Steven Lord
on 31 Mar 2020
Different countries use different decimal separators. I know Microsoft Excel has an option to specify the decimal and thousands separators. MATLAB has a preference to control what is used when exporting data via the clipboard.
Categories
Find more on Spreadsheets in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!