1
我試圖定義一個子功能foo的一個符號變量(見下文)如何在matlab的子函數中定義符號變量?正在獲取:「嘗試將」bar「添加到靜態工作區。」
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();
會感謝任何幫助理清以上內容