|
From: | Doug Stewart |
Subject: | Re: Auto-inflating series |
Date: | Tue, 8 Mar 2016 06:07:27 -0500 |
I say chaps,
I need to generate a series _expression_, like a Fourier series, but with a finite number of terms, that number being an integer variable. Coefficients within each term will also be variables, but that's not the problem.
It sounds like some string manipulation is called for, with a loop statement concatenating terms as required. Then I need to turn that string into an _expression_ to be evaluated. How do I do that? All help gratefully received.
TTFN
Richard.
_
# sring input and make it into an anonymous function # this uses the symbolic pkg. disp("Example input") disp("x^2 + 3*x - 1 + 5*x*sin(x)") str_fucn=input("please enter your function ","s") fucn_sym=sym(str_fucn) f=function_handle(fucn_sym) # now back to symbolic syms x; ff=formula(f(x));
etc.
[Prev in Thread] | Current Thread | [Next in Thread] |