Matlab: “Error using assignin: Attempt to add ”c“ to a static workspace”
问题 I have the following piece of function definition (test code): function [X,Y,Z] = test(x,y,z) syms a b c; a = b + c; % This is where it gets wrong X=x; Y=y; Z=z; keyboard % nested functions function y = fun1(t,x) y=t+x; end function res = bvpbc(y0,yT) res= y0+yT; end end Basically, I have some nested functions within the test function, where I declared some symbolic variables a , b and c . However, when I run the function by typing test(1,1,1) there is always this error message: Error using