# Harmonic Function Calculation In MatLab®

In general, harmonic functions in mathematics can be confused with the harmonic functions in music. But in here, we examine the calculation of harmonic functions in Matlab®. “Harmonic functions” is a very important topic of advanced calculus and mathematics. You can consider this link to seek further information about harmonic functions in mathematics.

Calcılation of harmonic functions in Matlab® is very simple with the ‘harmonic()’ command. Here, we show how to use the ‘harmonic()’ command in Matlab® to calculate harmonic functions with the given variables.

You can try the code example below in your Matlab® product.

On this post

## How To Use The ‘harmonic()’ Function In Matlab®?

``````>> harmonic(2)

ans =

1.5000

>> harmonic([2 6 3 45 63])

ans =

1.5000    2.4500    1.8333    4.3949    4.7283

>> ``````

As you see above, the use of the ‘harmonic()’ command to calculate harmonic functions in Matlab® is very simple. You just need to type the required value inside the brackets of the ‘harmonic()’ command.

You can calculate multiple values in one go. You can do this by typing multiple values inside the brackets of the ‘harmonic()’ command in a vector form.

## Conclusion

As you see above, Matlab® provides a very useful command to calculate harmonic functions easily.

Do not forget to leave your comments and questions below about the use of the ‘harmonic()’ command in Matlab® below.

YOU CAN LEARN MatLab® IN MECHANICAL BASE; Click And Start To Learn MatLab®!

If you want further coding examples about the ‘harmonic()’ command in Matlab®, inform us in the comments.