When I use the following code as a script it works without any error.
syms t real
syms w(t)
w=formula(w);
A=[sin(w);cos(w)];
But when I want to use the code inside a function which passes A matrix as an output, and I call the function I get this error:
"w" previously appeared to be
used as a function or command,
conflicting with its use here as
the name of a variable.
A possible cause of this error is
that you forgot to initialize the
variable, or you have initialized
it implicitly using load or eval.
2 件のコメント
このコメントへの直接リンク
https://jp.mathworks.com/matlabcentral/answers/449951-symfun-to-sym-conversion-error-only-in-a-function-not-script#comment_680873
このコメントへの直接リンク
https://jp.mathworks.com/matlabcentral/answers/449951-symfun-to-sym-conversion-error-only-in-a-function-not-script#comment_680873
このコメントへの直接リンク
https://jp.mathworks.com/matlabcentral/answers/449951-symfun-to-sym-conversion-error-only-in-a-function-not-script#comment_680888
このコメントへの直接リンク
https://jp.mathworks.com/matlabcentral/answers/449951-symfun-to-sym-conversion-error-only-in-a-function-not-script#comment_680888
サインインしてコメントする。