Non-linearly spaced axis

1 visualización (últimos 30 días)
Keunyoung Kim
Keunyoung Kim el 27 de Nov. de 2020
Comentada: Ameer Hamza el 27 de Nov. de 2020
I need to manually create a bode plot with my frequency values of [0.01 0.05 0.1 0.5 1 2 5 10 20 50 100 200 500],
magnitude of [-23.521920 -23.525300 -23.534820 -23.847406 -24.713787 -27.168337 -34.150448 -42.334723 -52.552808 -67.958800 -79.331525 -86.558043 -104.436975],
and phase of [-0.33 -1.90 -2.37 -19.10 -36.71 -60.53 -102.28 -132.75 -152.00 -167.24 -177.14 -198.62 -180.00].
Here is my graph when I plot in on MATLAB:
But I want the x axis to be like how it is in the actual bode plot like this:
ranging from 0.01 to 1000, with non-linear spacing. Can anyone tell me how I can fix this?
P.S. I'm sorry I don't know how to make the images small...

Respuesta aceptada

Ameer Hamza
Ameer Hamza el 27 de Nov. de 2020
You need to set the xscale to 'log'. Run the following line after creating the plot
xlim([0.01 1000])
set(gca, 'XScale', 'log')
  2 comentarios
Keunyoung Kim
Keunyoung Kim el 27 de Nov. de 2020
Thank you so much!
Ameer Hamza
Ameer Hamza el 27 de Nov. de 2020
I am glad to be of help!

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Get Started with Control System Toolbox en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by