Is it possible to store indefinite integral in a function handle and input values?
syms x
a=@(x)x^2;
b=@(x)int(a(x));
%E.g. when x=1 b=?
b(1)
%E.g. when x is a vector b=?
%int will always output x^n, but in order to plug in a vector it has to be changed to x.^n. Is there an automatic way to add the dot? I suppose I can use for loop and calculate b for each individual x and store it in a vector
x_1=1:0.1:10;
b(x_1)
Best Answer