Bug? sym alpha takes precedence over matlab's alpha.m at the command line, but not within a matlab function.
Mostrar comentarios más antiguos
When I run the following code, there is no problem:
syms xDot(t) t alpha
dF_dxDot = @(t) -exp(-t)*alpha*xDot(t)^(alpha-1);
Euler = matlabFunction(simplify(diff(dF_dxDot(t),t)),'vars',[t,alpha]);
But when I run the same code within a function.
function nothing
syms xDot(t) t alpha
dF_dxDot = @(t) -exp(-t)*alpha*xDot(t)^(alpha-1);
Euler = matlabFunction(simplify(diff(dF_dxDot(t),t)),'vars',[t,alpha]);
it throws an error,
Error using alpha
Too many output arguments.
since
which alpha
returns
/usr/local/MATLAB/R2016a/toolbox/matlab/graph3d/alpha.m
what appears to be happening is that my sym command takes precedence over matlab's command, provided I run the code within a regular script, but the precedence is reversed when I run it within a function. Surely this has to be a bug???
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Symbolic Math Toolbox en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!