Hello!
I have a string input that i transform into a symbolic equation. I need to translate "D(___)" into differentiation, but i can't make it work
syms t x x(t) D(x)eq_str = 'D(x)'; % input string equation
eq_sym = str2sym(eq_str); % transform equation to symbolic
eq_sym2 = subs(eq_sym,x,x(t)) % make x into a function of time
Dif = @(f) diff(f,t) % make Dif into a function handle
subs(eq_sym2,D,Dif) % returns 0, i want "diff(x(t),t)"
I dont think that "subs" is the correct way to do it, but i have not been able to find any other way
Thanks!
Best Answer