user537670
user537670

Reputation: 821

Calculating derivative and integration using matlab

I am trying to find second derivative of a function, but while initializing my symbols i am getting the following error:

Error using ==> subsindex
Function 'subsindex' is not defined for values of class 'sym'.

The commands I am using are:

syms x a b c L;
u = (a*x(x-L))+(b*x((x^2)-(L^2)))+(c*x((x^3)-(L^3)));

"u" is my function.

Upvotes: 0

Views: 412

Answers (1)

Edric
Edric

Reputation: 25160

I don't know much about MATLAB's symbolic capabilities, but that error is coming from the pieces like

x(x-L)

which MATLAB is interpreting as an indexing operation. Did you mean multiplication there? I.e.

x*(x-L)

Upvotes: 2

Related Questions