I have a need to open a variable number of files for output. Code later in the program will be conditionally writing data to these files. I wanted to be able to open these files in advance, instead of having to open and close them as each line is written resulting in a lot of opens and closes. I can't see a way to do this. I tried settign the filehandle as an array but that doesnt' work or I did it wrong e.g.
fhandle(i) = fopen(['OutputFile,i], 'w+');
Any way to programatically open several files and save their indexed handle names?
And, if possible, whats the limit on open files?