this programme in matlab 2017b but icant run it
2 views (last 30 days)
Tiasa Ghosh on 13 Aug 2018
For using Integral (), you must describe 'p' as a function handle with the '@' notation.Like this:
p = @(x) sqrt(2*(E-potential(x,a)));
This will work for Integral(). However, your second input to integral is 'x' which a symbolic variable. But Integral() accepts only scalar values as input. You need to change that.
More Answers (1)
Walter Roberson on 13 Aug 2018
p is defined in terms of the symbolic variable a. integral() is for numeric integration and cannot be used with unresolved symbolic variables.
Please recheck the order of parameters for your function. You define the function with one order but you call it with a different order.