0

好的,这是文本文件

{'samsung','n150','jp0xtr','n570','2gb','320gb','10','w7str'};
{'samsung','n150','jp0xtr','beyaz','intel','atom','n570','66','ghz','2048mb','ddr3','320gb','10','cam','bt','w7str'};
{'samsung','n150','jp0xtr','atom','n570','66ghz','2gb','320gb','10','netbook','w7s','beyaz'};
{'samsung','n150','jp0xtr','atom','n570','66ghz','2gb','320gb','10','netbook','w7s','beyaz'};
{'samsung','n150','jp0xtr','intel','atom','n570','66ghz','2gb','320gb','10','win7starter'};
{'samsung','n150jp0xtr','n570','2g','320gb','10','w7s','beyaz'};
{'samsung','n150','jp0xtr'};
{'samsung','n150','jp0xtr'};

现在我想将它加载为下面的单元格数组

在此处输入图像描述

我在这里使用了复制粘贴,但我想通过文件读取(文本文件)来做到这一点。我怎样才能做到这一点 ?谢谢你。

4

1 回答 1

1

只需将文本文件编辑为它的开头C = {和结尾,}并将扩展名更改为 .m。然后像从 matlab 命令行中的脚本一样运行它。

下次不要复制和粘贴,使用保存命令,如save ('monitor-list.txt', 'C', '-ASCII'). 然后,您可以使用load path-to-file.

于 2012-08-30T00:24:44.843 回答