0

Alright this is the text file

{'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'};

Now i want to load it as the below cell array

enter image description here

I used copy paste here but i want to do that via file reading (text file). How can i do that ? Thank you.

Furkan Gözükara
  • 22,964
  • 77
  • 205
  • 342

1 Answers1

1

Just edit the text file to that it starts with C = { and also ends in } and change the extension to .m. Then run it as if it was a script from matlab command-line.

Next time do not copy and paste, use the save command as in save ('monitor-list.txt', 'C', '-ASCII'). You can then load it easily with load path-to-file.

carandraug
  • 12,938
  • 1
  • 26
  • 38
  • thanks trying to run as command but it is giving error ??? Undefined variable "C_634818905985527822" or function "C_634818905985527822.m". here is the file http://dl.dropbox.com/u/88769323/C_634818905985527822.m – Furkan Gözükara Aug 30 '12 at 00:52
  • check the value of `pwd`. That's your working directory. Either move the file there or `cd` to where the file is. – carandraug Aug 30 '12 at 01:01
  • another error when i try to execute via file name : ??? Error: File: C_634818905985527822.m Line: 1 Column: 1 The input character is not valid in MATLAB statements or expressions. – Furkan Gözükara Aug 30 '12 at 01:01
  • then don't. From the command line try `run (path to file)`. It seems to me, considering your other questions, that you don't know Matlab. Also considering the things you are trying to do, you'd be better suited with a spreadsheet. Try [LibreOffice calc] (http://www.libreoffice.org/) – carandraug Aug 30 '12 at 01:12
  • yes i don't know matlab. but i have to use for one of my project. i am generating command files from C# :D – Furkan Gözükara Aug 30 '12 at 09:23