Digamma function is defined as the logarithmic derivative of the gamma function. You can find more detailed information about the digamma function from this link.
YOU CAN LEARN MatLab® IN MECHANICAL BASE; Click And Start To Learn MatLab®!
Matlab® provides a very simple and useful command which is the ‘psi()’ command. Here we explain how to use the ‘psi()’ command in Matlab® to calculate the digamma functions. The example below is executed in Matlab® command window. So, you can try it in your own Matlab product.
>> psi(10) ans = 2.2518 >>
As you see above, the ‘psi()’ command is very simple-to-use. You just need to type the value that you want to calculate its digamma function, inside the brackets of the ‘psi()’ command. Hit the ‘Enter’ key from your keyboard to see the result in the command window as above.
The equation of the digamma function is like the above. The value that you typed inside the brackets of the ‘psi()’ command is the ‘x’ in the equation above.
As you see that the use of the ‘psi()’ command to calculate the digamma functions is very simple in Matlab®. You can also type matrices or vectors inside the ‘psi()’ command.
Do not forget to leave your comments and questions below about the use of base conversion commands in Matlab® below.
If you want further coding examples about ‘sym’ and ‘syms’ commands in Matlab®, inform us in the comments.
This article is prepared for completely educative and informative purposes. Images used courtesy of Matlab®