Why does dlmread fail to import my csv files using my matlab 2016b installation when the same code works properly in my 2016a installation?

1 回表示 (過去 30 日間)
I'm importing a csv file using the following call: data = csvread(csvFilename.csv',5,0);
I'm skipping rows to leave out header information. Beginning on the 5th row of the file (base 0), there is a 197x23 array of numbers. The above function call works in my 2016a installation, but in 2016b, I get the error "Error using dlmread (line 147) Undefined function 'matlab.io.text.internal.collectOutput' for input arguments of type 'cell'."
Stepping through dlmread in debug mode in 2016a and 2016b, I didn't see any differences in the values of workspace variables during my function call.
The command "which matlab.io.text.internal.collectOutput" returned "'matlab.io.text.internal.collectOutput' not found." in the 2016a and 2016b installation.
Any ideas for troubleshooting?
  4 件のコメント
Walter Roberson
Walter Roberson 2016 年 10 月 31 日
That file works fine for me in R2016b on OS-X and on Windows 10.
Jianbin Tang
Jianbin Tang 2016 年 12 月 6 日
Hi, I have the same problem. Environment: CentOS 7
The problem only happen in 2016b. I tried 2016a and 2015b and works fine.

サインインしてコメントする。

採用された回答

Jeremy Hughes
Jeremy Hughes 2016 年 11 月 1 日
This sounds like an installation issue. The missing function should be installed with MATLAB. You may want to reinstall MATLAB, or contact support.
  1 件のコメント
Will S
Will S 2016 年 11 月 21 日
Issue resolved after contacting support. They fixed the issue after a reinstall and setting the matlab path back to defaults.

サインインしてコメントする。

その他の回答 (1 件)

Jianbin Tang
Jianbin Tang 2016 年 12 月 6 日
編集済み: Jianbin Tang 2016 年 12 月 6 日
From the error message, it seems like the MATLAB function 'matlab.io.text.internal.collectOutput' is not present on the MATLAB path. To verify this, please type the following command at the MATLAB command prompt:
>> which -all matlab.io.text.internal.collectOutput
If the output of running the above-mentioned command is something like " 'matlab.io.text.internal.collectOutput' not found" then it means the particular function is not present on the MATLAB path.
Since the above built-in function is not found, to restore the MATLAB path to its default, please execute the following three commands in the MATLAB command prompt.
>> restoredefaultpath
>> rehash toolboxcache
>> savepath
Please note that running these commands will remove any custom paths added to the MATLAB path, please refer the following documentation link on instructions about how to backup custom path: http://www.mathworks.com/matlabcentral/answers/166871-how-will-running-the-restoredefaultpath-and-savepath-commands-affect-my-custom-paths-and-how-do-i-ba
To verify that the 'matlab.io.text.internal.collectOutput' function is added to the path, please run the following command:
>> which -all matlab.io.text.internal.collectOutput
If the path is reset correctly, you should see the following output after running the above mentioned command:
>> MATLABROOT\toolbox\shared\io\+matlab\+io\+text\+internal\collectOutput.m % static method or package function
  2 件のコメント
Will S
Will S 2016 年 12 月 12 日
編集済み: Will S 2016 年 12 月 12 日
I don't think I can accept this answer in addition to the above, but I'm pretty sure that restoredefaultpath was one of the commands matlab support had me run when working on this issue, which did fix the problem. Readers take note that dlmread is not the problem - it was just the first function that errored for me - other functions could throw errors for this same reason. If anyone is having problems with built in matlab functions throwing errors saying they are undefined or getting warnings that toolboxes you have installed are not found, give this a try.
Tim Marks
Tim Marks 2017 年 1 月 30 日
Please change the accepted answer to Jianbin Tang's (you can still add your comment about how Apple Support had you reinstall). I had the exact same problem you did. I followed Jianbin's instructions, and it fixed the problem immediately. It's much preferable to Jeremy Hughes' answer (no offense intended to Jeremy), because Jianbin's fixed the problem in less than a minute, without needing to do a full reinstall of Matlab.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeInstall Products についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by