Doc command doesn't work

18 Ansichten (letzte 30 Tage)
Daniel Zuerbig
Daniel Zuerbig am 5 Mai 2022
Kommentiert: Daniel Zuerbig am 12 Mai 2022
I recently upgraded from R2019b to R2021b. I used to be able to type:
doc abs
or some other command and the documentation page for that command would pop up. Now when I type
doc <command>
I get this error:
Error using strjoin (line 38)
The first argument should be a cell array of strings.
Error in matlab.net.URI/get.EncodedPath (line 514)
str = strjoin(path, '/');
Error in matlab.net.URI/string (line 680)
path = obj.EncodedPath;
Error in matlab.net.URI/char (line 696)
str = string(obj);
Error in doc>displayFile (line 205)
com.mathworks.mlservices.MLHelpServices.setCurrentLocation(char(htmlFile));
Error in doc>displayDocPage (line 169)
displayFile(refPage);
Error in doc (line 120)
if ~displayDocPage(refTopics, topic) && ~showHelpwin(topic)
Error in doc (line 46)
feval( orig_doc, funcname );
I tried typing
doc "abs"
Which does bring up the documentation popup, but only as a search for "abs" and not the actual documentation page.
This happens for all commands, not just abs.

Akzeptierte Antwort

Walter Roberson
Walter Roberson am 5 Mai 2022
You have a third party product installed that defines its own strjoin.
Most likely culprit would be SPM12 which if I recall correctly defines strjoin in one of its "compatibility layers" directories. For a recent matlab version such as yours, the two compatability directories for SPM12 should be removed from the matlab path.
  5 Kommentare
Walter Roberson
Walter Roberson am 6 Mai 2022
That is not the current error message. The current error message is
First input must be a string array or cell array of character vectors.
Support for string objects was added around R2016b-ish (it took a couple of releases to update all functions.)
That error message would be consistent with the possibility that you are somehow getting an old version of strjoin that did not support string objects.
Daniel Zuerbig
Daniel Zuerbig am 12 Mai 2022
Thanks for your help! There was a redefinition of strjoin somewhere deep in our MATLAB repo. I changed the name of the function and it works now.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Creating, Deleting, and Querying Graphics Objects finden Sie in Help Center und File Exchange

Produkte


Version

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by