Hello, I have an issue I have been stuck on for a while. I have several .txt files that I want to import into matlab and produce a single table that I can export into an excel spreadsheet. I want to write a for loop that will select a range of files and then take the same data from each one which will then translate into severeal different variables onto a single table. I am very new to Matlab and any help would be much appreciated.
This should do the trick. I've added several comments in the hope that it makes it easier for you to understand how it works. Ofcourse you won't understand everything directly when you just start out using Matlab, but I suggest to just look up the stuff you don't understand in the documentation.
p.s. it's not my most beautiful creation but it works ;)
The following should work with multiple files now. So let's say I have the files M1-1.txt, M1-2.txt, M2-1.txt and M2-2.txt. Now it will save to a final table of 17-by-5, where the first column consists of the parameter names, the second column is M1-1.txt data, third column M1-2.txt, fourth column M2-1.txt and fifth column M2-2.txt. Hope this was the answer you were looking for.