我正在尝试在子函数 foo 中定义一个符号变量(见下文)
function [ ] = test2( )
foo();
function [] = foo ()
syms bar;
end
end
我收到以下错误,不确定如何解决此问题:
EDU>> test2
Error using assignin
Attempt to add "bar" to a static workspace.
See MATLAB Programming, Restrictions on Assigning to Variables for
details.
Error in syms (line 66)
assignin('caller',x,sym(x));
Error in test2/foo (line 6)
syms bar;
Error in test2 (line 3)
foo();
将不胜感激任何帮助整理上述