MATLAB: Problem with taking Differentiate from variable with counter ! variable diff counter Best Answer Well, the approach would be as follows:n=30;x=sym(zeros(1,n));%preallocationsyms tfor i=1:n x(i)=str2sym(sprintf('x%d(t)',i));endNow, you can easily take derivative of x as diff(x,t)and observe the result you want. Related SolutionsMATLAB: Solve for a variable in terms of specific other variables syms x(t) y(t) eq1 = x == y+2; deq = diff(eq1)deq(t) = isolate(deq, diff(y))ans = subs(ans, diff(x),5)ans = MATLAB: Is it possible to simplify symbolic expressions with known relations I assume (link) it would! syms x1 x2assume(x1*x2 == 1)a = x1*x2 + x1*x2;b = 2*aproducing: b =4*x1*x2 Related QuestionSubstitute only first derivative in symbolic toolboxApply diff to function handleSubstitution on symbolic functionUsing dsolve to equation
Best Answer