I implemented a bash script in matlab, which returns a char array with all the outputs (echo). Now I would like to use the data stored in the array, to open a file. Unfortunately, I don't know how to convert the array into a string. The following code works:
[status, output] = system('./script.sh', '-echo');
filename = [ output(1) output(2) output(3) output(4) output(5) output (6) ];
But it is not very convenient and doesn't allow different lengths of the filename. Is there an easy way to solve this?