将单元格的字符串解析为单元格
我在 MATLAB 中有以下字符串:
contents = '{'aa' 'bb' 'cc' 'dd'}'
我需要获取其中的 1x4 元胞数组,例如:
mycell = {'aa' 'bb' 'cc' 'dd'}
你会怎么做?有没有比解析更快的方法?
I have the following string in MATLAB:
contents = '{'aa' 'bb' 'cc' 'dd'}'
I need to get the 1x4 cell-array inside it, like:
mycell = {'aa' 'bb' 'cc' 'dd'}
How would you do it? Is there a quicker way than parsing it?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

发布评论
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
这是一个巧妙的方法(如果我正确地捕获了你最初的问题)
“结果”是一个 1x4 单元格。
Here's a nifty way (if I've captured your initial question correctly)
"result" is a 1x4 cell.