semilogTick
Version 1.0.0 (1.57 KB) by
Damiano Cirielli
Generate engineering-notation spaced tick in a x-axis logarithmic frequency plot (semilogx or loglog)
You can find useful this function if you are plotting a bode diagram (or any other graph) using a frequency axes in a logarithmic scale.
Using this function you can change the scientific notation of the ticks (default) with a much more easy to read, based on engineering notation multipliers. The result would be the same you can see on the graph displayed on an instrument screen, for instance 1k, 10k, 100k, 1M, 10M, 100M...
For example, if you have measured one inductor and you want to plot the graph of the acquired inductance with the frequency axes which looks like the one in this plot:
you can use the function in this way:
figure
semilogx(freq,L./1e-6) % freq is the frequancy axes vector (in Hz), L is the inductance vector (in H, plotted in microHenries), both read previously from a csv file
grid on
title('BalUn inductance','fontsize',30,'FontName','Times new Roman')
xlabel('f (Hz)','fontsize',23,'FontName','Times new Roman')
ylabel('inductance (\muH)','fontsize',23,'FontName','Times new Roman')
graphTick = get(gca,'xtick');
label = semilogTick(freq,graphTick);
set(gca,'XTickLabel',label);
if your frequency axes is written, for instance, in MHz, you can use the 3rd parameter 'multiplier' of the function:
label = semilogTick(freq,graphTick,1e6);
Cite As
Damiano Cirielli (2026). semilogTick (https://www.mathworks.com/matlabcentral/fileexchange/117545-semilogtick), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Created with
R2022a
Compatible with R2006a and later releases
Platform Compatibility
Windows macOS LinuxTags
Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.
| Version | Published | Release Notes | |
|---|---|---|---|
| 1.0.0 |
