Possible Duplicate:
How can I index a MATLAB array returned by a function without first assigning it to a local variable?
I would like to use indexing on the output of a function. I use the textscan function to read very large text files (15 GB). The return of the textscan function in my case is a 1×1 cell array that contains a very large numeric array.
Instead of doing:
tmp = textscan(...);
final_result = mat2cell(tmp{1,1});
I would like to do:
final_result = mat2cell( textscan(...){1,1} );
If this would work, it would avoid the creation of the very large temporary variable tmp. Is there another way to avoid the temporary variable?
In case you are still wondering, consider this example:
Here is the cellarray-version of @gnovice answer in the linked question (ugly but works):