Error using table/vertcat
7 ビュー (過去 30 日間)
古いコメントを表示
Christoph Funke
2020 年 10 月 15 日
コメント済み: Christoph Funke
2020 年 10 月 30 日
Hi all,
I have been getting an error in the function 'vertcat'. It can be reproduced on my machine by the simple code:
a = array2table(['1', '1']);
b = array2table(['2', '2']);
[a;b]
The code above yields the error message:
Error using table/vertcat
Error: File: vertcat.m Line: 158 Column: 1
Illegal use of reserved keyword "catch".
Error in test (line 3)
[a;b]
Any idea what may be causing this and how to fix it? It appears to be a local error - if I run the same code on a different machine with the same version of MATLAB (2018b), it works fine. I initially thought that I accidently changed something in the vertcat function, but that appears not to be possible since I can't access the source code.
1 件のコメント
Mathieu NOE
2020 年 10 月 15 日
hi
you should better describe what is the intention, data inputs and expected outputs
seems just you are not using this function for what it is intended for ... at least in the example
採用された回答
Walter Roberson
2020 年 10 月 30 日
Error: File: vertcat.m Line: 158 Column: 1
In R2018b, toolbox/matlab/datatypes/@tabular/vertcat.m does indeed have a catch at column 1 of line 158 . However, it is a valid catch
So, somehow, somewhere between line 17 of the file and line 158, your file has acquired an extra end statement.
You should probably reinstall MATLAB.
その他の回答 (1 件)
Manvi Goel
2020 年 10 月 30 日
I tried reproducing it at my end and just like you mentioned, it works as expected and the arrays concatenate vertically. It might be a temporary issue that you're facing. Try restarting MATLAB and your local system.
In case this doesn’t work you can restore the default MATLAB search path with the following steps:
1. Take a backup of your 'pathdef.m' file, which can be located by using the command
>> which -all pathdef
Before proceeding, ensure that you make a safe copy of the file by copying it to a folder outside of your MATLAB path.
2. After taking the backup, execute the following commands in the MATLAB Command Window to restore the default MATLAB search path and rehash the toolbox cache:
>> restoredefaultpath
>> rehash toolboxcache
>> sl_refresh_customizations
After this step, please use MATLAB/ Simulink to see if the issue occurs again. If the issue is resolved, then you may want to save the new MATLAB search path by executing the following command:
>> savepath
NOTE: This will remove any custom paths you may have created. The following MATLAB Answers post is an additional resource on how to back them up:
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Startup and Shutdown についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!