ITKeyword,专注技术干货聚合推荐

注册 | 登录

How to write a cell of strings to Excel in Matlab?

itPublisher 分享于

2020腾讯云双十一活动,全年最低!!!(领取3500元代金券),
地址https://cloud.tencent.com/act/cps/redirect?redirect=1073

【阿里云】双十一活动,全年抄底价,限时3天!(老用户也有),
入口地址https://www.aliyun.com/1111/home

up vote 0 down vote favorite I am trying to write a short function that will take a cell of strings and will write it as is to Excel: Excel =

'r2g'

'r3g'

't2g'

't3b'

'c3b'

'r1r'

'r1g'

'r3r'

't3g'

't1r'

't1b'

't2b'

't3r'

'c1r'

't3g'

'r2b'

'r1g'

'c3b'

'c2b'

'c1b'

'c3r'

'c3g'

't2r'

'c1b'

'r1g'

'r1b'

'r3b'

'c1r'

't1r'

'r1r'

't3b'

'r2r'

't1r'

'r1r'

't3r'

't1g'

'r3r'

'r2g'

'c1r'

'r1g'

'c1g'

'r2g'

'r3r'

'r2b'

'c3r'

'c3b'

'c1b'

'r3g'

't1g'

't3r'

't1r'

'r2b'

'r3r'

't3g'

'r1g'

'c2g'

'r2g'

't1b'

'c1b'

'c1r'

'c3b'

't1r'

'r3b'

'r1r'

'r2r'

'c1b'

'c2g'

'c2b'

't1b'

'r2g'

'r2b'

'c3b'

't2g'

'c2r'

'c1b'

'c1g'

't3b'

'c2b'

'c3r'

't1r'

't3r'

't1r'

'r1r'

't2b'

'r3r'

'r1b'

't3b'

'c3g'

'c3b'

'r1g'

'r3b'

't2g'

'r2r'

'r1r'

't3b'

'c3b'

'c1r'

'r2g'

't1r'

'c2r'

I want each triplet to be in a different cell in Excel. I looked at the answers here regarding the strings array but they didn't work for me. string excel matlab cell
  |
  this question edited Feb 19 '12 at 23:57 Jonas Heidelberg 3,744 17 34 asked Feb 19 '12 at 13:53 user552231 422 1 10 23      Have a look at your older questions... do 50% really have no acceptable answer? You should accept the best answer if it more or less solves your problem; otherwise people won't want to help you any more... –  Jonas Heidelberg Feb 20 '12 at 0:04



 |  1 Answers

up vote 1 down vote ---Accepted---Accepted---Accepted---

You can just use the xlswrite function: xlswrite('filename.xls', yourMatrix);

Edit: This function can accept either a matrix or a cell array. Thanks to commenters for pointing that out.
  |
  this answer edited Feb 20 '12 at 12:12 answered Feb 19 '12 at 14:18 feralcreature 86 4 1   xlswrite can accept a call array. –  Pursuit Feb 19 '12 at 15:26 1   If you need to write cell array of strings you just pass it to xlswrite, it will work. Don't use cell2mat. You'd better to remove it from the answer. –  yuk Feb 20 '12 at 4:17



 | 

up vote 0 down vote favorite I am trying to write a short function that will take a cell of strings and will write it as is to Excel: Excel =

'r2g'

'r3g'

't2g'


相关阅读排行


×
  • 登录
  • 注册

×

请激活账号

为了能正常使用评论、编辑功能及以后陆续为用户提供的其他产品,请激活账号。

您的注册邮箱: 修改

重新发送激活邮件 进入我的邮箱

如果您没有收到激活邮件,请注意检查垃圾箱。