I've narrowed down the error to the function gppretty.m, but substituting "sym" for "str2sym" doesn't solve the problem
GPTIPS 2, Symbolic Regression. Error
10 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Luis J Gilarranz
am 14 Feb. 2019
Kommentiert: Luis J Gilarranz
am 22 Mai 2019
Hi,
I'm using GPTIPS 2 (https://sites.google.com/site/gptips4matlab/) to come up with a model that fits some data. The code runs, and I get the pareto front of models etc. However, I’m getting an error related to the symbolic toolbox.
For instance, when using “gpmodelreport(gp,84)” I get a screen print saying “Simplifying model ...” and then, an error
Error using gpmodel2sym (line 103)
Could not get symbolic object(s) for this model. Error using sym>convertChar (line 1459)
Character vectors and strings in the first argument can only specify a variable or number. To evaluate character vectors and strings representing symbolic expressions, use ‘str2sym’.
That error also shows up when I do “comparemodelsREC”, “gpmodel2sym”, “uniquegenes”...
Any idea?
Cheers!
LJ
Akzeptierte Antwort
xox ir
am 18 Mär. 2019
Hello,
please create this function:
function y=xsym(x)
if isnumeric(x)
x=num2str(x);
end
y=str2sym(x);
Then add the code below:
if~verLessThan('matlab','9.3');sym=@xsym;end
At the begaining of gppretty.m
1 Kommentar
Weitere Antworten (0)
Siehe auch
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!