MATLAB Answers

Oscarin
0

How can I make derivatives with several variables?

Asked by Oscarin
on 5 Sep 2018
Latest activity Edited by Oscarin
on 23 Oct 2018 at 1:48
Hello I have a problem, I tryed to derive a equation like "a1^2*a2^2" but I got "ans = 2*a1*a2^2", This result is correct but If we take as variable only "a1" but I need to take as varible "a1" and "a2". I want to get this becase is a multiplication:
I have used diff () this is my code:
what is the correct way to say matlab which are my variables?
Thank you very much I wait for your answer.

  0 Comments

Sign in to comment.

Products


Release

R2017b

2 Answers

Answer by Walter Roberson
on 15 Sep 2018
 Accepted Answer

You can use gradient() to find the diff(), and you could sum() the result.

  35 Comments