Error with integration Not enough argument

1 visualización (últimos 30 días)
turki mohammed
turki mohammed el 26 de Feb. de 2020
Respondida: Walter Roberson el 27 de Feb. de 2020
I add a pic of the problem help really needed,thanks.
  2 comentarios
Mohammad Sami
Mohammad Sami el 27 de Feb. de 2020
There is no function called int in matlab.
You can either use the function cumtrapz (for numerical data) or integral (for function handle)
See the topic in help file below
Walter Roberson
Walter Roberson el 27 de Feb. de 2020
Incorrect, int is part of the symbolic toolbox

Iniciar sesión para comentar.

Respuestas (1)

Walter Roberson
Walter Roberson el 27 de Feb. de 2020
We cannot see how you created t but the error message tells us that y2 is double precision, and that could only happen if t is double precision.
The symbolic toolbox contains int() but it requires a symbolic expression or symbolic function as its first parameter. If for example you had done
syms t
then the way you create y2 would be valid to pass to int()
Perhaps you have initialized t as a numeric vector and were hoping for numeric integration over the vector. int() is only for symbolic integration, not numeric integration. Numeric integration of an existing numeric vector can be done in various ways including by using trapz()

Productos

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by