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);
引用格式
Damiano Cirielli (2025). semilogTick (https://ww2.mathworks.cn/matlabcentral/fileexchange/117545-semilogtick), MATLAB Central File Exchange. 检索时间: .
MATLAB 版本兼容性
创建方式
R2022a
与 R2006a 及更高版本兼容
平台兼容性
Windows macOS Linux标签
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!版本 | 已发布 | 发行说明 | |
---|---|---|---|
1.0.0 |