Updated 09 Nov 2018
If you have bought MATLAB & don't have the symbolic math toolbox, then you are free to use the repository as per the terms of the license under which it is released, to find out First Order Derivative & Second order derivative at a specified point of your choice. The repository can also be used to find out partial derivatives of a quadratic equation at a specified point of your choice.
Soumyabrata Bhattacharjee (2018). Derivative (https://www.github.com/Soumyabrata111/Derivative), GitHub. Retrieved .
Hello Stephen, I have modified the files. Now, it doesn't use 'inline' command anymore. CLEAR & CLC commands are there to make the window look clean every time the script runs. It shouldn't cause any problem if those commands are left out. The file uses hard-coded value because the motive behind the file is that, it gets fair enough answers & anyone whos's requiring a few lines, to implement in their code, to get derivatives of the mathematical functions, can refer to this repo & get the required job done. The repo is an open source one, released under GNU General Public License v3.0
Thanks Stephen for providing a genuine feedback. Will release a new version with the suggested modifications soon :)
Neatly written and tidy code, but needs some improvements.
For example, why do these scripts CLEAR my workspace and CLC the command window? What possible purpose does this serve, that these scripts' functionality depends on? Does my workspace data cause problems for these scripts? What happens if I want to continue working with my workspace data?
The scripts use INPUT for the user to specify the function, which is converted to the (almost) obsolete and totally outdated INLINE function type. The INLINE help states at the very top "inline will be removed in a future release. Use Anonymous Functions instead", so why do these scripts not use anonymous functions, just as the documentation recommends?
The actual derivative is calculated by using a hard-coded value to calculate two X values, from which the derivative is estimated, e.g.:
x1 = x + .000001 * x;
Why use a hard-coded value? How was this value picked?
Note that this method makes no attempt to deal with discontinuities, so user beware!
In this release, the equation(s) can be taken as input from the user, without using the 'inline' command, as the command may get discontinued by MathWorks in it's future releases.
Create scripts with code, output, and formatted text in a single executable document.