In MatLab®, there are some special codes to convert your 2D graphs into logarithmic curves. In this article, we will explain the use of these commands to obtain logarithmic graph curves in Matlab® with a very basic example below.
How To Use ‘semilogx(), semilogy() and loglog()’ Commands In MatLab®?
As you see above we created a vector called ‘t’ and created another vector that depends on the variable ‘t’ as shown by the blue arrow above. What we did is, we typed these two variables inside the parentheses of semilogx() command as shown by the green arrow. At the created graph, you can see that the curve and the x-axis are exponential or logarithmic.
YOU CAN LEARN MatLab® IN MECHANICAL BASE; Click And Start To Learn MatLab®!
If we draw this graph with the plot() command, the curve would be linear.
The same logic is valid for the semilogy() command which is for the y axis again in Matlab®.
At this time, we used the loglog() command like the semilogx() command to create a curve. At this time, the curve is linear. But X and Y axes are depicted in a logarithmic way as shown by blue arrows. The logarithmic calculation is done for two axes, because of that, the curve is linear on the graph.
The use of semilogy(), semilogx(), and loglog() exponential graph drawing commands is very easy like above. Leave your comments and questions below about semilogy(), semilogx() and loglog() commands in Matlab®!
This article is prepared for completely educative and informative purposes. Images used courtesy of Matlab®
Your precious feedbacks are very important to us.
Leave a Reply