I currently have a function which I am batch running. It outputs its results to a cell array. I would like to export each of the outputs from the cell array to their own variable.
As such I have a variable id which records the ID of each layer. This process is possible manually as follows:
>> output =
[300x300x2 double] [300x300x2 double] [300x300x2 double]
>> [a1,a2,a3]=deal(output{:});
Where the number after a represents the ID. Is it possible to automate this command, so that the prefix (in this case: a) can be set by the user and the id filled in automatically? As in, I could have variables set as below, and use these in the deal command to name my new variables?
>> id =
1 2 3
>> prefix =
a
Any ideas? Thanks.
prefix= 'r'; id = [1:1:3] for i=1:length(id) s = ['[' layer int2str(id) '] = deal(cell{i});']; eval(s); end