Frequency Response Function Plotting: Difference between revisions

From Control Systems Technology Group
Jump to navigation Jump to search
No edit summary
No edit summary
 
(One intermediate revision by the same user not shown)
Line 3: Line 3:


;Files:  
;Files:  
Note: Wikipedia automatically changes the first letter of a filename to uppercase. To avoid warnings in Matlab, save the file in lowercase.
[[File: Frf.zip]],containing
 
* frf.m
[[File: Frf.m]], [[File: Frfmag.m]], [[File: Frfphase.m]]
* frfmag.m
* frfphase.m
* frfhold.m
* frflabel.m




Line 12: Line 15:
* Optimized for MIMO systems
* Optimized for MIMO systems
* Enable use of custom colors (lightgrey, darkgrey, pink, etc.)
* Enable use of custom colors (lightgrey, darkgrey, pink, etc.)
* Adjustable linewidth and marker size
* Easy to adjust limits
* Easy to adjust limits
* Plot only magnitude or phase using the frfmag() and frfphase() functions
  Usage:  frf(sys1,'color/linetype/linewidth/marker/markersize',sys2,'color/linetype/linewidth/marker/markersize',...
            ...{fmin,fmax,magmin,magmax,phasemin,phasemax,wraponoff,type})
  Inputs:  You can use custom colors, e.g. lightgrey, pink, etc. (see line ~315)
            To use the . marker give \. as marker (to distinguist from dots in linewidth specs)
            example strings: 'lightgrey--1.5o12'    lightgrey dashed line with circle marker of size 12
                            'orange\.'            orange solid line, dot marker
                            'b*10'                blue markers size 10, no line
            All elements in the options-struct are optional
            fmin/fmax in Hz
            magmin/magmax in dB
            phasemin/phasemax in degrees
            wraponoff: [ 'on' | 'off' (default) ]
            type: [ 'mag' | 'phase' | 'magphase' (default) ]
  Outputs: Plots the frf in the current figure.
            Note that the xticklabels might overlap the xlabel in the
            figure. In an exported pdf file they will be correct.
<br/>
;Example frf.m vs bode.m
The size of these example pictures is such that they would fit in a two column formatted page, as in journal and conference papers.
[[File:frf.jpg|400px|left]] <br/> <br/> frf.m
<br style="clear:both"/>


    Usage:   frf(sys1,'color/linetype/marker',sys2,'color/linetype/marker',...
[[File:bode.jpg|400px|left]] <br/> <br/> bode.m
            ...{fmin,fmax,magmin,magmax,phasemin,phasemax,wraponoff,type})
           
            frfmag(sys,...) and frfphase(sys,...) use the same syntax but only plot
            the magnitude or phase plot respectively
           
    Inputs:  You can use custom colors, e.g. lightgrey, pink, etc. (see line 180)
            example strings: 'b', 'lightgrey--*', 'orange', '-^'
 
            All elements in the options-struct are optional
            fmin/fmax in Hz
            magmin/magmax in dB
            phasemin/phasemax in degrees
            wraponoff: [ 'on' | 'off' (default) ]
            type: [ 'mag' | 'phase' | 'magphase' (default) ]
    Outputs: Plots the frf in the current figure.
            Note that the xticklabels might overlap the xlabel in the
            figure. In an exported pdf file they will be correct.


;Example: frf.m vs bode.m
<br style="clear:both"/>
[[File:frf.jpg]][[File:bode.jpg]]


;Author: Rob Hoogendijk
;Author: Rob Hoogendijk

Latest revision as of 14:46, 15 October 2013

Back to Matlab Tools


Files

File:Frf.zip,containing

  • frf.m
  • frfmag.m
  • frfphase.m
  • frfhold.m
  • frflabel.m


Description
Plot Frequency Response Function with
  • Correct label sizes
  • Optimized for MIMO systems
  • Enable use of custom colors (lightgrey, darkgrey, pink, etc.)
  • Adjustable linewidth and marker size
  • Easy to adjust limits
  • Plot only magnitude or phase using the frfmag() and frfphase() functions
  Usage:   frf(sys1,'color/linetype/linewidth/marker/markersize',sys2,'color/linetype/linewidth/marker/markersize',...
           ...{fmin,fmax,magmin,magmax,phasemin,phasemax,wraponoff,type})
  Inputs:  You can use custom colors, e.g. lightgrey, pink, etc. (see line ~315)
           To use the . marker give \. as marker (to distinguist from dots in linewidth specs) 
           example strings: 'lightgrey--1.5o12'    lightgrey dashed line with circle marker of size 12 
                            'orange\.'             orange solid line, dot marker 
                            'b*10'                 blue markers size 10, no line
           All elements in the options-struct are optional
           fmin/fmax in Hz
           magmin/magmax in dB
           phasemin/phasemax in degrees
           wraponoff: [ 'on' | 'off' (default) ]
           type: [ 'mag' | 'phase' | 'magphase' (default) ]
  Outputs: Plots the frf in the current figure.
           Note that the xticklabels might overlap the xlabel in the
           figure. In an exported pdf file they will be correct.


Example frf.m vs bode.m

The size of these example pictures is such that they would fit in a two column formatted page, as in journal and conference papers.

Frf.jpg



frf.m


Bode.jpg



bode.m


Author
Rob Hoogendijk