Error using table/vertcat
7 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Christoph Funke
am 15 Okt. 2020
Kommentiert: Christoph Funke
am 30 Okt. 2020
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 Kommentar
Mathieu NOE
am 15 Okt. 2020
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
Akzeptierte Antwort
Walter Roberson
am 30 Okt. 2020
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.
Weitere Antworten (1)
Manvi Goel
am 30 Okt. 2020
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 Kommentare
Siehe auch
Kategorien
Mehr zu Startup and Shutdown finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!