MATLAB Programming/Semilog
[MATLAB Programming\|/MATLAB Programming]m]
Chapter 1: MATLAB ._.
Introductions .
Chapter 2: MATLAB Concepts
Chapter 3: Variable Manipulation
Chapter 4: Vector and matrices
Chapter 5: Array
- Arrays
- Introduction to array operations
- Vectors and Basic Vector Operations
- Mathematics with Vectors and Matrices
- Struct Arrays
- Cell Arrays
Chapter 6: Graphical Plotting
- Basic Graphics Commands
- Plot
- Polar Plot
- Semilogx or Semilogy
- Loglog
- Bode Plot
- Nichols Plot
- Nyquist Plot
Chapter 7: M File Programming
Chapter 8: Advanced Topics
- Numerical Manipulation
- Advanced File I/O
- Object Oriented Programming
- Applications and Examples
- Toolboxes and Extensions
Chapter 9: Bonus chapters
- MATLAB Benefits and Caveats
- Alternatives to MATLAB
- [MATLAB_Programming/GNU_Octave|What is Octave= (8) hsrmonic functions]
- Octave/MATLAB differences
Note that this page is a copy of the ControlTheoryPro.com page on semilogx/y commands.
Introduction
[edit | edit source ]The semilogx or semilogy commands plot data with 1 axis linear and the other axis log scale. The semilogx command plots the data on the x-axis on a log scale. For controls this is particularly useful when manually creating a bode plot.
Bode Plots
[edit | edit source ]The MATLAB bode plot is very convenient but when the plot needs to be formatted then the bode command makes this difficult. As a result this author (Gabe 13:30, 20 April 2008 (CDT)) creates bode plots using the following commands
freqVec=logspace(-1,3,5000); [mag,phs]=bode(sys,freqVec*(2*pi)); mag=db(mag(:)); phs=phs(:); figure; subplot(2,1,1) semilogx(freqVec,mag) gridon title('System Bode Plot') ylabel('Magnitude (dB)') subplot(2,1,2) semilogx(freqVec,phs) gridon ylabel('Phase (deg)') xlabel('Frequency (Hz)')