Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
给定一个由频谱图函数创建的图形,如何根据以下公式设置刻度?
(12 × log2 (f / 440)) + 69
[f是轴上的当前值,公式的结果应该替换它]
f
如果我正确理解您的问题...可能有更有效的方法,但我认为这可行:
data = rand(1,1000); plot(data) f = get(gca,'Xtick'); new_ticks = (12 * log2((f / 440) + 69)) set(gca,'Xticklabels', new_ticks)
这使 x 轴缩放保持不变,但会根据您提供的公式更改刻度标签。