From: Raymond's Group Lee on
James Allison <james.allison(a)mathworks.com> wrote in message <hq9u43$ej$1(a)fred.mathworks.com>...
> Try:
>
> f = @(x) x ;
> g = @(x) x^2 ;
> h = @(x) f(x) + g(x) ;
>
> -James
>
> Raymond's Group Lee wrote:
> > I am wondering there is anyway we can add 2 functions, f(x) and g(x),
> > together.
> >
> >
> > f = @(x) x ;
> > g = @(x) x^2 ;
> > h = @(x) f + g ;
> > This does not work.
> >
> > If this is possible, I can use it to define function like
> >
> > f(x) = x + x^2 + x^3 + ...+ x^100 + ... + x^1000 ;
> >
> > Thanks.

James, thank you so much.