How to write a fraction on xticklabel?
Show older comments
this is my code:
%plot absolute value of 4 filters%
f = linspace(-pi, pi, 80);
LPFs = figure();
suptitle('Absolute Frequency Responses of LPFs');
%H2%
subplot(2,2,1)
FT_h2 = abs(fftshift(fft(h2)));
xlabel('\omega [rad]');
ylabel('Magnitude of H2');
plot(f,FT_h2);
ticklabelinterpreter = 'latex';
xticks([-pi -pi/2 -pi/3 -pi/4 -pi/6 0 pi/6 pi/4 pi/3 pi/2 pi]);
xticklabels({'-\pi','$\frac{-\pi}{2}$','-\pi/3','-\pi/4','-\pi/6','0','\pi/6','\pi/4','\pi/3','\pi/2','\pi'});
but the result is:

Accepted Answer
More Answers (0)
Categories
Find more on Matrices and Arrays in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!