MATLAB: Does UIIMPORT not work correctly if I specify an output argument

6.5filei/oindexMATLABoutputr13uiimport

If I use UIIMPORT without specifying an output argument, it works as expected. If I specify an output argument; however, I get the following :
>> s=uiimport('test.txt')
Warning: Index exceeds matrix dimensions.
> In D:\Applications\MATLAB6p5\toolbox\matlab\uitools\uiimport.p (doFinish) at line 541
In D:\Applications\MATLAB6p5\toolbox\matlab\uitools\uiimport.p at line 107
s =
[]
In this case 'test.txt' is a very simple CSV file.

Best Answer

This bug has been fixed in Release 14 Service Pack 2 (R14SP2). For previous releases, please read below for any possible workarounds:
This bug has been fixed for Release 14 (R14). For previous releases, please read below for any possible workarounds:
As a workaround, please follow these steps:
1) Delete $MATLAB/toolbox/matlab/uitools/uiimport.p, where $MATLAB is your MATLAB root directory.
2) Edit the $MATLAB/toolbox/matlab/uitools/uiimport.m file.
3) Change line 493 of the uiimport.m file from
out.(vname) = ad.datastruct(names{i});
to
out.(vname) = ad.datastruct.(names{i});
by adding a period between "datastruct" and "(names{i})";
4) Exit and restart MATLAB.