复制和过去的MATLAB字符数组到Excel W / O行情 [英] Copy and Past MATLAB Character Array into Excel w/o Quotes
问题描述
我有我复制到Excel US preadsheet一个MATLAB字符数组,但每当我将其粘贴成S preadsheet,在每个单元开始字符串和引号结束。有什么办法给数组到Excel粘贴不带引号?我知道我可以只查找和替换所有没有引号的,但考虑到有串内的一些报价,它会做的事情很多,如果有更好的解决方法更简单。感谢您的帮助!
I have a MATLAB character array that I am copying into an Excel spreadsheet, but whenever I paste it into the spreadsheet, the string in each cell starts and end with quotes. Is there any way to paste the array into Excel without the quotation marks? I know that I could just find and replace all of the quotation marks with nothing, but given that there are some quotes within the strings, it'd make thing a lot easier if there was a better work-around. Thanks for the help!
推荐答案
您可以从电池阵列到一个字符数组改变摆脱报价。使用制表符字符串分隔将其粘贴到Excel中单独的细胞在默认情况下。
You can get rid of the quotes by changing from a cell array to a char array. Using the tab character to separate the strings will make it paste into separate cells in excel by default.
例如:
A={'A' 'B' 'C'}; %Create the cell array.
cell2mat(strcat(A,{sprintf('\t')})) %Create a char array separated with tabs
这输出复制到Excel中。
Copy this output into excel
这篇关于复制和过去的MATLAB字符数组到Excel W / O行情的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!