Reputation: 243
I'm working on an script that uses sym functions within a loop, because of the way my functions are defined. Also I need to use their derivatives. I cannot just write down the explicit matlab function for each, so defining each individual function and derivatives is not an option.
the code is this:
[out]=sym_script(n)
syms x;
out=[];
for i=1:n
Function=sin(x)+i*x;
out=[out Some_operation(Function,vec)];
end
(min example, actual sym function more complicated ) the problem is that matlab seems to be unable to overwrite Function if it is syms.
I have tried the script in Matlab 2015a for pc and mac and get the same error in both.
Upvotes: 1
Views: 130
Reputation: 243
Never mind the trouble was inside other function I called in the loop. It had a variable named "diff" which caused conflict with the matlab's function diff() to calculate derivatives.
Upvotes: 0